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

Implement max bucket limit and automatic resolution reduction #6104

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Jul 22, 2024

What this PR does:

Introduce a new limit max_native_histogram_buckets which limits maximum number of buckets of a native histogram sample. When exceeding the limit, Distributor will try to reduce the ingested histogram resolution until it is within the buckeet limit or the resolution can't be reduced anymore.

Which issue(s) this PR fixes:
Fixes #6092

Checklist

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

Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
@@ -722,6 +725,11 @@ func (o *Overrides) EnforceMetadataMetricName(userID string) bool {
return o.GetOverridesForUser(userID).EnforceMetadataMetricName
}

// MaxNativeHistogramBuckets.
Copy link
Member

Choose a reason for hiding this comment

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

nit: Can we add comment on what this function is doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in latest commit.

@@ -52,6 +52,9 @@ const (
exemplarLabelsTooLong = "exemplar_labels_too_long"
exemplarTimestampInvalid = "exemplar_timestamp_invalid"

// Native Histogram specific validation reasons
nativeHistogramBucketsExceeded = "native_histogram_buckets_exceeded"
Copy link
Member

Choose a reason for hiding this comment

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

Can we make the error more specific like nativeHistogramBucketCountLimitExceeded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed in latest commit.

Signed-off-by: Ben Ye <benye@amazon.com>
@CharlieTLe CharlieTLe merged commit b167dd4 into cortexproject:master Jul 23, 2024
16 checks passed
@yeya24 yeya24 deleted the max-bucket-limit branch July 26, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce max bucket count limit for native histograms
2 participants