-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Rework Desc and ConstMetrics #222
Comments
This should, after all, go into 0.10, as it will break a lot of code. |
With the bucket layout in the Desc, validating the bucket layout can be part of validating the Desc, i.e. invalid bucket layouts will show up at registration time. Currently, a panic is triggered during NewHistogram (which is OK) but in a HistogramVec only at the point a new histogram element in the histogram vector is created, i.e. during the WithLabels etc. call. That's sometimes hard to spot, especially if it occurs in the HTTP serving path where panics are recovered by the HTTP library. |
I'd suggest a look at https://github.com/prometheus/client_python#custom-collectors CounterMetricFamily and friends that Python/Java has. It makes the simple cases really easy for custom collectors. |
Note to self to consider #516 to make Desc's useful for generating documentation. |
- Use local registry to avoid conflicts between tests. - Expose prometheus/client_golang#299 by using ConstLabels in a test. - Improve example: Buckets and help string must be consistent, even if the former is not enforced as of now, but see prometheus/client_golang#222
The text was updated successfully, but these errors were encountered: