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

InfluxDB: Fix aliasing with $measurement or $m on backend mode #76917

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

itsmylife
Copy link
Contributor

@itsmylife itsmylife commented Oct 20, 2023

What is this feature?

When you have multiple measurements in the response and have $measurement or $m as alias, the result is not being rendered properly. This PR is addressing that issue by getting the measurement from the response itself.

Who is this feature for?

InfluxDB backend mode users who have $measurement or $m as alias and have multiple measurements

Which issue(s) does this PR fix?:

Fixes #52844

Special notes for your reviewer:

How to test it?

  • enable InfluxDB backend mode influxdbBackendMigration=true
  • Go to explore and select influxdb datasource (ideally 1.x version for easy testing)
  • Switch to code editor
  • Paste this query SELECT mean("value") FROM /.*/ WHERE $timeFilter GROUP BY time($__interval) fill(null)
  • Paste $measurement as alias
  • Observe you get no measurement in the legend and in the table columns
  • Switch to this branch and try again
  • Observe that you get your measurements

Copy link
Contributor

@bohandley bohandley left a comment

Choose a reason for hiding this comment

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

LGTM!

@itsmylife itsmylife merged commit 5eb0b2b into main Oct 23, 2023
28 checks passed
@itsmylife itsmylife deleted the ismail/influxdb-alias-with-$measurement branch October 23, 2023 15:36
@itsmylife itsmylife added backport v10.2.x and removed no-backport Skip backport of PR labels Oct 30, 2023
grafana-delivery-bot bot pushed a commit that referenced this pull request Oct 30, 2023
* better interpolation $measurement aliasing

* unit tests

(cherry picked from commit 5eb0b2b)
itsmylife added a commit that referenced this pull request Oct 30, 2023
…ode (#77383)

InfluxDB: Fix aliasing with $measurement or $m on backend mode (#76917)

* better interpolation $measurement aliasing

* unit tests

(cherry picked from commit 5eb0b2b)

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
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.

Unified alerting InfluxDB Alias By $measurement does not work.
3 participants