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

Mimir rejects valid exemplars with err-mimir-exemplar-labels-missing #7904

Closed
gouthamve opened this issue Apr 15, 2024 · 13 comments
Closed

Mimir rejects valid exemplars with err-mimir-exemplar-labels-missing #7904

gouthamve opened this issue Apr 15, 2024 · 13 comments
Labels

Comments

@gouthamve
Copy link
Member

Describe the bug

Seeing errors like:

ts=2024-04-14T14:27:50.976027765Z caller=push.go:171 level=error user=12690 msg="push error" err="received an exemplar with no valid labels, timestamp: 0 series: blackbox_module_unknown_total{job=\"unknown_service:blackbox_exporter\"} labels: {} (err-mimir-exemplar-labels-missing)"

From: open-telemetry/opentelemetry-go-contrib#5383 (comment)

According to the OpenMetrics spec it's ok to have Exemplars without labels:

Exemplars without Labels MUST represent an empty LabelSet as {}.

There's even an example in the spec:
foo_bucket{le="0.1"} 8 # {} 0.054
Why does Mimir reject this?

To Reproduce

Send an exemplar with no labels to Grafana Cloud.

Expected behavior

Return a 200 OK, not a 400 error.

@56quarters
Copy link
Contributor

56quarters commented Apr 16, 2024

The Prometheus TSDB code drops exemplars with no labels which is why Mimir rejects them on ingest. It wasn't a problem in practice until now because Prometheus never sends exemplars with no labels.

@56quarters
Copy link
Contributor

56quarters commented Apr 16, 2024

Discussion here when some of the logic to reject empty exemplars was added: #873

@aknuds1
Copy link
Contributor

aknuds1 commented Apr 18, 2024

@gouthamve since this behaviour is by design in Prometheus, can the issue be closed? Or do you think it should be reconsidered in Prom?

@aknuds1 aknuds1 added the question Further information is requested label Apr 18, 2024
@gouthamve
Copy link
Member Author

I think it needs to be reconsidered in Prometheus. We should atleast not drop them with 400s because OTel seems produce a ton of these empty exemplars.

When that happens, the customers alerts start firing because their writes are failing, and the logs are full of the err-mimir-exemplar-labels-missing error message. This is a sub-par experience for customers.

@colega
Copy link
Contributor

colega commented May 20, 2024

I'm curious, what's the use case for an exemplar without labels?

@gouthamve
Copy link
Member Author

From an OTel and specification perspective, its "example values". For this histogram, these are the example values we recorded. @RichiH / @fstab can you chime in further?

@fstab
Copy link
Member

fstab commented May 21, 2024

👍 yes, I think it's just example values.

As it's defined in the OpenMetrics spec, and in the OpenTelemetry spec, we should support this. It's maybe ok to ignore the Exemplar itself, but dropping the entire time series is certainly not spec compliant.

@colega
Copy link
Contributor

colega commented May 21, 2024

I think that dropping the entire time series is a critical bug that deserves a separate issue.

I also think that we should not reject the empty exemplars just because Prometheus doesn't send those.

@gouthamve gouthamve changed the title Rejecting valid exemplars with err-mimir-exemplar-labels-missing Mimir rejects valid exemplars with err-mimir-exemplar-labels-missing May 29, 2024
@bboreham
Copy link
Contributor

bboreham commented Jun 4, 2024

I'm curious, what's the use case for an exemplar without labels?

When visualized, the values give a better idea of distribution. Especially when buckets are coarse, exemplars can suggest you have a particular modal value, or bimodal distribution, etc.

@colega
Copy link
Contributor

colega commented Jun 4, 2024

Thank you, @bboreham, I figured out that myself :D

@bboreham
Copy link
Contributor

bboreham commented Jun 4, 2024

I created a feature request upstream prometheus/prometheus#14208

@bboreham
Copy link
Contributor

bboreham commented Jun 5, 2024

The Prometheus TSDB code drops exemplars with no labels

I believe this was a misunderstanding. Nick's source is me at #873, where I said it would be confusing.
I was originally proposing that Mimir should reject an exemplar with labels like {trace_id=""}, which will be stored as {}.

@gouthamve
Copy link
Member Author

Closed in #8224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants