go-kit / kit

A standard library for microservices.
https://gokit.io
MIT License
26.35k stars 2.42k forks source link

Upgrade to prometheus/client_golang 1.12.2 #1243

Closed rootulp closed 1 year ago

rootulp commented 1 year ago

What would you like?

https://github.com/go-kit/kit/blob/50c38262a8c71be2532f45100e622025bc5ffedf/go.mod#L23

I'd like to leverage new features in prometheus/client_golang 1.12.2. Are there any objections to upgrading this dependency?

ChrisHines commented 1 year ago

How do you want to leverage the new features? Do you want to use them in Go kit code or your own code?

rootulp commented 1 year ago

In a consuming application (celestiaorg/celestia-core) I wanted to use counter.Inc() which I thought was only available in 1.12.2 (here) but it also appears available in 1.11.1 (here). So I investigated this codebase a little more and learned that my feature request would imply adding Inc() to https://github.com/go-kit/kit/blob/50c38262a8c71be2532f45100e622025bc5ffedf/metrics/metrics.go#L5-L8

and this method may not be applicable to counters for other packages in https://github.com/go-kit/kit/tree/50c38262a8c71be2532f45100e622025bc5ffedf/metrics

Do you have thoughts here? It's likely that this issue can be closed as not planned

peterbourgon commented 1 year ago

Feel free to add a PR that adds Inc to Counter, but it's not obvious to me that

c.Inc()  // is better than
c.Add(1) // in any meaningful sense
peterbourgon commented 1 year ago

Said another way,

I'd like to leverage new features in prometheus/client_golang 1.12.2. Are there any objections to upgrading this dependency?

You don't need to upgrade the dependency to use the new features. So I guess I'll close this for now.