sttp icon indicating copy to clipboard operation
sttp copied to clipboard

Update to Prometheus 1.x.x

Open KarelCemus opened this issue 2 years ago • 2 comments

Prometheus made incompatible changes in v1.x.x and some libraries such as Tapir already migrated to the latest version of Prometheus so it would be helpful to update this project also into latest Prometheus to allow use of Tapir with sttp backend.

Right now, this project still depends on Prometheus v0.x.x code.

KarelCemus avatar Nov 29 '23 14:11 KarelCemus

Unfortunately, there are some serious breaking changes in the 1.x line.

For example, as far as I can tell it's no longer possible to provide custom buckets for histograms, a functionality that was previously there and sttp exposed to the user. So, if I'm understanding it correctly, updating prometheus will also imply a breaking change in sttp. Not sure how far away sttp4 is from being released, but it could be it'll be the only version with the new prometheus client.

I quickly tried to update the dependency myself in a fork, but gave up because of the above - the upgrade isn't big per se, but requires some choices that will impact sttp's API.


In the meantime, what you can do in your own project is add the simpleclient bridge.

This at least makes sttp and tapir work together nicely again, but it's of course a temporary solution until sttp is able to use prometheus-client 1.x

andreazube avatar Feb 12 '24 14:02 andreazube

Maybe we can update to 1.x.x in sttp4, and keep the old version in sttp3, wdyt?

adamw avatar Feb 17 '24 10:02 adamw

I might be wrong but classicUpperBounds method in histogram builder is suitable to make custom buckets. I hope sttp4 will be released soon, didn't expect tapir and sttp dependencies to diverge.

Awethon avatar Mar 05 '24 16:03 Awethon