-
Notifications
You must be signed in to change notification settings - Fork 548
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
distributor: report OTLP parse errors back to client #10588
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Vladimir Varankin <[email protected]>
Signed-off-by: Vladimir Varankin <[email protected]>
Signed-off-by: Vladimir Varankin <[email protected]>
@aknuds1 I think you may be the best one for the review here (it is not urgent, though) |
Taking a look! |
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.
Please see comments. Mainly, I think you should avoid the inlining since I think it's a step in the wrong direction (towards less readable code). Also if I'm not mistaken, the inlining is just a (significant) stylistic change so it shouldn't be done in this PR, which is meant to fix a bug.
pkg/distributor/otel.go
Outdated
level.Debug(spanLogger).Log( | ||
"msg", "OTLP to Prometheus conversion complete", | ||
"metric_count", metricCount, | ||
"metric_dropped", metricDropped, |
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.
"metric_dropped", metricDropped, | |
"metrics_dropped", metricsDropped, |
Signed-off-by: Vladimir Varankin <[email protected]>
Co-authored-by: Arve Knudsen <[email protected]>
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 modulo nits. Thanks!
@@ -203,6 +291,7 @@ func OTLPHandler( | |||
level.Debug(spanLogger).Log( | |||
"msg", "OTLP to Prometheus conversion complete", | |||
"metric_count", metricCount, | |||
"metric_dropped", metricsDropped, |
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.
Plural metrics are dropped:
"metric_dropped", metricsDropped, | |
"metrics_dropped", metricsDropped, |
|
||
mimirTS := c.converter.TimeSeries() | ||
return mimirTS |
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.
[Nit] Easier to read:
mimirTS := c.converter.TimeSeries() | |
return mimirTS | |
return c.converter.TimeSeries() |
What this PR does
This PR comes with mostly structural changes. The idea here is that, currently,
OTLPHandler
silently drops series, it couldn't parse. This makes it complicated for the users, who see the increase in the dropped OTLP series due to a parse error, but who don't have access to the internal logs (e.g. when Mimir is deployed in Grafana Cloud).Here, the handler holds the errors received during the OTLP conversion, and, if there wasn't any explicit issues from the downstream push services, it returns the status 400 (it's up for a debate if this new behaviour is more correct; refer to the internal discussion https://github.com/grafana/mimir-squad/issues/2716).
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.