-
Notifications
You must be signed in to change notification settings - Fork 806
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
Add metrics to track ingesting native histograms #6370
Add metrics to track ingesting native histograms #6370
Conversation
021bc82
to
2e01fdb
Compare
2e01fdb
to
d39de75
Compare
pkg/ingester/ingester.go
Outdated
} | ||
|
||
// Distributor counts both samples, metadata and histograms, so for consistency ingester does the same. | ||
i.ingestionRate.Add(int64(succeededSamplesCount + ingestedMetadata)) | ||
i.ingestionRate.Add(int64(succeededSamplesCount + succeededHistogramCount + ingestedMetadata)) | ||
|
||
switch req.Source { | ||
case cortexpb.RULE: | ||
db.ingestedRuleSamples.Add(int64(succeededSamplesCount)) |
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.
Why we don't update this?
pkg/ingester/ingester.go
Outdated
@@ -1400,7 +1413,7 @@ func (i *Ingester) Push(ctx context.Context, req *cortexpb.WriteRequest) (*corte | |||
if errors.As(firstPartialErr, &ve) { | |||
code = ve.code | |||
} | |||
level.Debug(logutil.WithContext(ctx, i.logger)).Log("msg", "partial failures to push", "totalSamples", succeededSamplesCount+failedSamplesCount, "failedSamples", failedSamplesCount, "firstPartialErr", firstPartialErr) | |||
level.Debug(logutil.WithContext(ctx, i.logger)).Log("msg", "partial failures to push", "totalSamples", succeededSamplesCount+succeededHistogramCount+failedSamplesCount+failedHistogramCount, "failedSamples", failedSamplesCount, "failedHistogram", failedHistogramCount, "firstPartialErr", firstPartialErr) |
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.
If we want to separate out samples and histograms then let's add a dedicated totalHistograms
.
failedHistogram => failedHistograms
// we must already have copied the labels if succeededHistogramCount has been incremented. | ||
return copiedLabels | ||
}) | ||
} |
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.
Can we combine this part with the code above so that we only update series once?
shouldUpdateSeries := (succeededSamplesCount > oldSucceededSamplesCount) || (succeededHistogramCount > oldSucceededHistogramsCount)
if i.cfg.ActiveSeriesMetricsEnabled && shouldUpdateSeries {...}
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.
Can we introduce a variable instead? To avoid the line to be too long
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.
Thanks
2defe54
to
2fb3ec3
Compare
Signed-off-by: SungJin1212 <[email protected]>
2fb3ec3
to
49a2cbc
Compare
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.
Thanks!
@alanprot |
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.
LGTM
This PR adds two ingester metrics
cortex_ingester_ingested_native_histograms_total
andcortex_ingester_ingested_native_histograms_failures_total
to track ingesting native histogram.Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]