-
Notifications
You must be signed in to change notification settings - Fork 9.8k
tsdb: add count of histogram samples to block stats #16824
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
Conversation
Signed-off-by: Ahmed Hassan <afayekhassan@gmail.com>
LGTM! It'll be good to keep track of Native histogram samples in blocks separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my head "Sample" is a generic word, can be float sample or native histogram sample, so I don't think it's technically wrong. Which also means that I think the numbers should look like this:
or breaking:
But you can get float samples with a simple subtract and also people generally don't care, it's more about getting info on native histograms. Note: I don't think we even documented these block stats anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approve with nit
Signed-off-by: Ahmed Hassan <afayekhassan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
I like the explicit trinity of NumSamples/NumFloatSamples/NumHistogramSamples. No breaking change, and no misunderstandings possible after having see the three names. |
## Manual follow-ups @krajorama : I've updated the engine tests from upstream (prometheus/prometheus#16725). There was one that has a different error message with MQE so I only added it to *ours* tests. Maybe we want to fix the error message instead? Commented. @krajorama : I've followed up the block stats changes (prometheus/prometheus#16824) by adding the necessary code in Mimir and also more tests. I've followed BlockStats.NumSamples to find all occurrences. Even if I wasn't successful , we don't actually use the new fields for anything critical - so this should be safe. ## Update mimir-prometheus dependency *This PR was automatically created by the [update-vendored-mimir-prometheus.yml](https://github.com/grafana/mimir/blob/main/.github/workflows/update-vendored-mimir-prometheus.yml) workflow.* ### Details: - **Source branch/ref**: [`main`](https://github.com/grafana/mimir-prometheus/tree/main) - **Previous commit**: [`609b9c7c04c1`](grafana/mimir-prometheus@609b9c7c04c1) - **New commit**: [`8323300263566d178c6d571d985924fbd4270225`](grafana/mimir-prometheus@8323300) - **Changes**: [`609b9c7c04c1...8323300263566d178c6d571d985924fbd4270225`](grafana/mimir-prometheus@609b9c7...8323300) --------- Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com> Co-authored-by: mimir-github-bot[bot] <mimir-github-bot[bot]@users.noreply.github.com> Co-authored-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com> Co-authored-by: Charles Korn <charles.korn@grafana.com>
do we want to expose this on Line 1724 in 294f36e
maybe as a part of the new Well, it's already the case, it's exposed on |
Currently TSDB metadata tracks the following stats
Native histogram samples have different properties compared to normal float/int samples, and can vary a lot in size. While they are counted as samples in
numSamples
, it is useful to have a separate metric that tracks how many native histograms samples there are in a block.This PR introduces a
numHistogramSamples
stat without touching any of the other existing stats.