Skip to content
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

Reduce histogram resolution instead of rejecting #6535

Merged
merged 16 commits into from
Nov 15, 2023

Conversation

krajorama
Copy link
Contributor

@krajorama krajorama commented Nov 2, 2023

What this PR does

Introduce new configuration parameter to be able to disable the new function.
Reduce native histogram resolution instead of rejecting it if it is above bucket limit.

Which issue(s) this PR fixes or relates to

Fixes #5367

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama requested a review from a team as a code owner November 2, 2023 10:01
@krajorama krajorama marked this pull request as draft November 2, 2023 10:01
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama marked this pull request as ready for review November 13, 2023 10:01
@krajorama krajorama requested a review from a team as a code owner November 13, 2023 10:01
@krajorama krajorama marked this pull request as draft November 13, 2023 10:50
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Use "reduce" instead of "downscale" everywhere.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama marked this pull request as ready for review November 13, 2023 11:18
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
}

func (h *Histogram) reduceFloatResolution() (int, error) {
if h.Schema == -4 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a meaningful constant for this somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added definition in the same file. I looked again, but it's never exported from Prometheus, so I have to make a PR in Prometheus first to solve it...

Copy link
Contributor

@colega colega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert in all the code that comes from Prometheus, but that already had its review. The new code putting it here looks good to me. Consider my comment about adding a constant for that -4, it seems really strange to someone who never saw anything about native histograms.

@krajorama krajorama enabled auto-merge (squash) November 15, 2023 06:48
@krajorama krajorama merged commit dfa4056 into main Nov 15, 2023
28 checks passed
@krajorama krajorama deleted the krajo/native-histogram-reduce-resolution branch November 15, 2023 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

native histograms: Reduce resolution instead of dropping when bucket limit is hit
2 participants