go-metrics icon indicating copy to clipboard operation
go-metrics copied to clipboard

? About exposing Registerer & Gatherer

Open jhorwit2 opened this issue 9 years ago • 5 comments

Right now the library is using the default registry (which is also a Gatherer). Is a goal of this library to not expose the underlying prometheus objects by wrapping them? I want to submit a PR that exposes the registerer & gatherer being utilized by the library. The gatherer is particularly useful because it enables us to do things with the metrics beyond just exposing them on /metrics; like sending task metrics from the daemon to managers using protobuf.

You can see what I'm talking about here for the gatherer and here for registerer

jhorwit2 avatar Aug 28 '16 19:08 jhorwit2

cc @crosbymichael

jhorwit2 avatar Aug 28 '16 19:08 jhorwit2

@jhorwit2 i would also like to not use the default one because other packages that we import in our project are having their metrics registered. Will your change prevent that from happening?

crosbymichael avatar Aug 29 '16 16:08 crosbymichael

@crosbymichael the changes I made make it easier to not use the default. Want me to include that (very easy)? I'll also need to tweak the handler to use promhttp.HandlerFor so it doesn't use default.

jhorwit2 avatar Aug 29 '16 16:08 jhorwit2

@jhorwit2 sure, are you going to open a PR? It sounds like a good idea, just want to see the actual changes. Thanks for the help

crosbymichael avatar Aug 29 '16 16:08 crosbymichael

@crosbymichael Yup, i'll open one now.

jhorwit2 avatar Aug 29 '16 16:08 jhorwit2