New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor package metrics #313
Conversation
8f3c165
to
f407af6
Compare
@jprobinson Would you mind taking a look at the new package provider, and making sure it's still suitable to your needs? I believe it should be straightforward, but you know best :) |
Sorry for the delay. I like the new look, but need to spend a lil time digging deeper and make sure I don't have any pain points on my side. I'll try to get to it today or tomorrow when I get some time. |
Take your time, and thank you! |
Looks good, @peterbourgon! I've got a PR on Gizmo awaiting the changes. |
Thanks @basvanbeek for the spot. Embarrassing!
Great, ship it! Thanks to everyone who helped validate. |
* metrics updates to match go-kit/kit#313 * changing histograms to use duration.Seconds()
Sorry but you're using the clever stuff in Go that I don't understand well enough so I'm baffled. |
@adrianco You can't access generic.Histogram.Print from an expvar.Histogram. If you want the Print method, you should create and pass around generic.Histogram instead of metrics.Histogram. That's because the metrics.Histogram types have become explicitly write-only. |
OK, so I've stopped using metrics package completely, and using *generic.Histogram seems to work, but the generic print function doesn't print anything useful.
Changed to
|
Wow, that's not helpful at all! :) Let me dig in a bit. |
I think the pretty print of histograms was only be in the extvar implementation? |
Trying to learn to use go-kit and have been following the example at https://gokit.io/examples/stringsvc.html when I came upon problems with the metrics (undefined metrics. Fields). Some googling and I found this refactor. Updated examples would make it easier to learn this stuff. Anyone have link to working examples with the refactored go-kit? |
Thanks for the report. I've fixed the website. The code in the repo has always been correct, for the record. |
This is a complete rewrite of package metrics. Here is the complete new metrics.go file. I'm inlining it because it's pretty and I'm proud of it.
Major and/or breaking changes:
Minor changes: