-
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
histograms: Support exemplars in pure Native Histograms #1126
Comments
Idea: keep a schema for the exemplars. At the beginning the exemplar schema would be the same as the buckets schema. The exemplar schema "buckets" will cover the same range of values as the normal buckets, but at a much lower resolution. We could keep a maximum N exemplars per exemplar schema bucket (M). So max MxN. We'd automatically get selection of sampled exemplars per logarithmic range. |
Note that exemplars directly added to native histograms MUST have a timestamp, see prometheus/client_model#61 and prometheus/prometheus#13021 for details. |
Since prometheus/client_model#61 is solved, I would love to take this issue. If ok, you can assign to me @beorn7 @carrieedwards |
Thank you @fatsheep9146 . I have assigned this issue to you. Feel free to discuss selection heuristics on Slack, if you need inspiration beyond what has been discussed above. |
Before I support exemplars in pure native histogram in client golang, should we release the |
True. I'll add the new tag ASAP (hopefully later today). |
The dependency in prometheus server should also be updated, I will also do this after the new tag is ready. @beorn7 |
The tag is in place! https://github.com/prometheus/client_model/releases/tag/v0.6.0 |
Broad idea for the heuristics:
This should lead to an even spread of exemplars, while not keeping any individual exemplar for overly long. |
"Find the two exemplars that are closest to each other on an exponential scale." For example, there exists two exemplars which has value 4, 6, the histogram schema is 0, the max count of exemplar is 2. So we should drop 6, keep 4, 5. Do I understand this correctly? |
Yes, sounds about right. A naive implementation of this could be quite expensive, though, especially if many exemplars are to be kept around. However, for one I assume the number of exemplars will be generally small (around 10?). Also, you can probably play many tricks, like the following:
|
This depends on prometheus/client_model#61 .
Exemplars can be added to the buckets of conventional histograms but not to native histograms. So far, the way of sending exemplars is by also rendering a conventional histogram. With the issue above fixed, we have a way of sending exemplars independently of conventional buckets. However, without conventional buckets, we don't have a heuristics which exemplars to pick. Native histograms can have so many buckets that adding an examplar to each is infeasible.
This is P2 as explained in the milestone's description.
The text was updated successfully, but these errors were encountered: