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

[v10.4.x] Tempo: Better fallbacks for metrics query #83688

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

grafana-delivery-bot[bot]
Copy link
Contributor

Backport 036e190 from #83619


What is this feature?

This PR fixes a couple of bugs we were seeing when Tempo returned no labels or labels with empty values for a specific query when using the metrics endpoint.

When there are no labels and the results contains a single series, we fallback to the query string, to mimic the Prometheus datasource.

When the value for a label is an empty string we force the series name to be "" since this is the actual value of the label. In Tempo the values are typed so we know that "" is the value of empty string instead of the absence of value.

Why do we need this feature?

We were seeing errors and undesired behaviours when querying the metrics endpoint of Tempo.

Who is this feature for?

Users of the Tempo datasource.

Which issue(s) does this PR fix?:

Fixes grafana/tempo#3429

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

* Use query as fallback when there's one series and no labels. Use "" as the fallback for empty label values. Stop using the `promLabels` value from the Tempo response

* Set refId to remove mentions of promLabels

* Add quotes around the string value, add space after comma separator

* Use name as refId when possible

(cherry picked from commit 036e190)
@adrapereira adrapereira enabled auto-merge (squash) February 29, 2024 12:46
@adrapereira adrapereira merged commit e74ffd5 into v10.4.x Feb 29, 2024
22 checks passed
@adrapereira adrapereira deleted the backport-83619-to-v10.4.x branch February 29, 2024 12:57
@aangelisc aangelisc modified the milestones: 10.4.x, 10.4.0 Mar 6, 2024
@zserge zserge modified the milestones: 10.4.0, 10.4.x Mar 12, 2024
@mdvictor mdvictor modified the milestones: 10.4.x, 10.4.1 Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants