docker / go-metrics

Package for metrics collection in Docker projects
Apache License 2.0
87 stars 32 forks source link

? About exposing Registerer & Gatherer #6

Open jhorwit2 opened 8 years ago

jhorwit2 commented 8 years ago

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 commented 8 years ago

cc @crosbymichael

crosbymichael commented 8 years ago

@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?

jhorwit2 commented 8 years ago

@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.

crosbymichael commented 8 years ago

@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

jhorwit2 commented 8 years ago

@crosbymichael Yup, i'll open one now.