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

OTLP: Add metrics to track otlp request samples per batch #8265

Merged
merged 5 commits into from
Jun 6, 2024

Conversation

ying-jeanne
Copy link
Contributor

@ying-jeanne ying-jeanne commented Jun 3, 2024

What this PR does

This PR intent to address #6935 (comment), we need to use the same limit unit for otel collector and mimir, it should be number of samples per batch and aligned with send_batch_max_size. Before doing so, we need better understanding what are the batch size now from users.

The added bucket is based on our recommendation 8192

Note: there is no fancy way to test native histogram metrics exported today.

Which issue(s) this PR fixes or relates to

Fixes: #8269

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.

@ying-jeanne ying-jeanne force-pushed the metrics-track-sample-per-batch branch from 113aa1c to cfef061 Compare June 3, 2024 19:51
@ying-jeanne ying-jeanne force-pushed the metrics-track-sample-per-batch branch 2 times, most recently from 1c3f81f to 78f00a2 Compare June 3, 2024 19:53
@@ -281,6 +282,11 @@ func newPushMetrics(reg prometheus.Registerer) *PushMetrics {
NativeHistogramMinResetDuration: 1 * time.Hour,
NativeHistogramMaxBucketNumber: 100,
}, []string{"user"}),
otlpIncomingSamplesPerBatch: promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately this will create a lot of series (number of tenants using OTLP * number of distributors * (number of buckets + 2)). It's around 700k series altogether in our production environments. If we used native histograms only, it would be 1/10th of that.

If we go with native histograms, I'd recommend using factor=2, 4 or 16 (buckets would be have boundaries that are exponents of the factor).

Copy link
Contributor Author

@ying-jeanne ying-jeanne Jun 4, 2024

Choose a reason for hiding this comment

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

after discussed offline with Peter, I am going to change factor to 2 and max bucket to 100.

@ying-jeanne ying-jeanne force-pushed the metrics-track-sample-per-batch branch from 78f00a2 to b3317e5 Compare June 4, 2024 18:46
@ying-jeanne ying-jeanne force-pushed the metrics-track-sample-per-batch branch from b3317e5 to a63fb85 Compare June 4, 2024 18:47
@ying-jeanne ying-jeanne marked this pull request as ready for review June 4, 2024 18:47
@ying-jeanne ying-jeanne requested a review from a team as a code owner June 4, 2024 18:47
@bboreham
Copy link
Contributor

bboreham commented Jun 5, 2024

I'd like to suggest we track these numbers for all sources together (remote-write and OTLP), since it is equally interesting for remote-write, and the common case is that each customer picks just one method.

Also it would be good to have the number of exemplars tracked similarly.

@ying-jeanne ying-jeanne force-pushed the metrics-track-sample-per-batch branch 2 times, most recently from 16cbd34 to 9e0cafc Compare June 5, 2024 21:04
@ying-jeanne ying-jeanne marked this pull request as draft June 5, 2024 21:09
@ying-jeanne ying-jeanne force-pushed the metrics-track-sample-per-batch branch from 9e0cafc to 3bbfff2 Compare June 6, 2024 14:34
@ying-jeanne ying-jeanne marked this pull request as ready for review June 6, 2024 14:38
@ying-jeanne ying-jeanne enabled auto-merge (squash) June 6, 2024 14:40
ying-jeanne and others added 2 commits June 6, 2024 14:23
Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Ying WANG <ying.wang@grafana.com>
@ying-jeanne ying-jeanne merged commit 50c9a02 into main Jun 6, 2024
29 checks passed
@ying-jeanne ying-jeanne deleted the metrics-track-sample-per-batch branch June 6, 2024 19:53
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.

otlp: Add metrics to track samples per batch for otlp request
3 participants