Skip to content

Conversation

krajorama
Copy link
Contributor

@krajorama krajorama commented Apr 7, 2025

What this PR does

Add support Native Histograms with Custom Bucket over Remote Write.

Which issue(s) this PR fixes or relates to

Fixes #7817

Checklist

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

Copy link
Contributor

github-actions bot commented Apr 7, 2025

💻 Deploy preview deleted.

@krajorama krajorama mentioned this pull request Apr 7, 2025
10 tasks
@krajorama krajorama force-pushed the krajo/rw2-nhcb branch 2 times, most recently from e51eeed to ebebdf0 Compare April 7, 2025 15:00
Base automatically changed from krajo/wip-rw2-direct to main April 9, 2025 13:16
Add support Native Histograms with Custom Bucket over Remote Write.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama marked this pull request as ready for review April 9, 2025 13:25
@krajorama krajorama requested review from tacole02 and a team as code owners April 9, 2025 13:25
@@ -52,6 +52,8 @@ var softErrProcessor = mimir_storage.NewSoftAppendErrorProcessor(
func([]mimirpb.LabelAdapter) {}, func([]mimirpb.LabelAdapter) {}, func(error, int64, []mimirpb.LabelAdapter) {},
func(error, int64, []mimirpb.LabelAdapter) {}, func(error, int64, []mimirpb.LabelAdapter) {},
func(error, int64, []mimirpb.LabelAdapter) {}, func(error, int64, []mimirpb.LabelAdapter) {},
func(error, int64, []mimirpb.LabelAdapter) {}, func(error, int64, []mimirpb.LabelAdapter) {},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Question to reviewers: Is this having any performance impact? We're passing more pointers on the heap I assume?

Copy link
Contributor

@tacole02 tacole02 left a comment

Choose a reason for hiding this comment

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

Left some comments. Thanks so much, @krajorama !

krajorama and others added 2 commits April 10, 2025 08:44
Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com>
Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@aknuds1 aknuds1 requested a review from a team April 11, 2025 15:01
@aknuds1 aknuds1 added enhancement New feature or request component/distributor labels Apr 11, 2025
@aknuds1 aknuds1 requested a review from Copilot April 11, 2025 15:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

integration/distributor_test.go:546

  • [nitpick] The introduction of a negative value in PositiveDeltas may be non-intuitive given that bucket counts are typically non-negative; please verify that this test data intentionally represents the desired custom bucket behavior.
PositiveDeltas: []int64{150, -100},

@@ -287,6 +288,12 @@ func validateSampleHistogram(m *sampleValidationMetrics, now model.Time, cfg sam
} else {
bucketCount = len(s.GetNegativeDeltas()) + len(s.GetPositiveDeltas())
}
if s.Schema == mimirpb.NativeHistogramsWithCustomBucketsSchema {
Copy link
Preview

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

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

The error returned for custom buckets uses the generic 'notReducibleNativeHistogramMsgFormat'. Consider defining a dedicated error message for NHCB to clearly indicate that custom bucket histograms cannot be scaled down.

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, I think the error message could be more clear for this scenario, and specifically mention that the error is thrown because custom bucket native histograms cannot undergo a reduction in resolution.

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@tacole02 tacole02 left a comment

Choose a reason for hiding this comment

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

Looks really good, a couple of really small nits. Thanks so much for fixing all of these notes, @krajorama !

krajorama and others added 2 commits April 11, 2025 18:40
Co-authored-by: Taylor C <41653732+tacole02@users.noreply.github.com>
Copy link
Contributor

@carrieedwards carrieedwards left a comment

Choose a reason for hiding this comment

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

Looks great!

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama krajorama merged commit 9de31cf into main Apr 14, 2025
28 checks passed
@krajorama krajorama deleted the krajo/rw2-nhcb branch April 14, 2025 08:20
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.

Vendor custom bucket native histograms (nhcb) from Prometheus
4 participants