rcrowley / go-metrics

Go port of Coda Hale's Metrics library
Other
3.43k stars 493 forks source link

Allow users to register the `expvar` endpoint with other HTTP routers #166

Closed jprobinson closed 7 years ago

jprobinson commented 8 years ago

If a user is not using http.ServeDefaultMux with their server, the current expvar handler will not get exposed.

github.com/NYTimes/gizmo currently uses go-metrics under the hood and I would like to add a new 'EnableExpvar` configuration to the toolkit that would allow users to expose their metrics via HTTP.

To handle this, we'll need to expose the http.Handler used in the exp package so folks can register it with whatever router they need.

svperfecta commented 8 years ago

Yeah, we have the same problem. :) Nice fix.

mihasya commented 7 years ago

ty @jprobinson for the fix