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

Graphite: Fix splitting expressions in tag_value with template variables #86958

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EduardZaydler
Copy link

What is this feature?

correct spilitting expressions in tag_value with template variables, grafana produce incorrect query for resolve variable with tag_values when depend on multi-value variable with several selected items

Why do we need this feature?
So the graphite queries work as expected

How to reproduce it:

Add 2 variables
route="test1,test2" (Custom type)
gateway="tag_values(route, route = ${route})" (Query on Graphite Datasource with refresh on Time Range Change)

On dashboard for variable route try to select test1 and test2

For resolve variable route incorrect query was formed

/api/datasources/proxy/2/tags/autoComplete/values?expr=route = {test1&expr=test2}&tag=route&limit=10000&from=1619180806&until=1619181708

Correct query parameter for expr=route is

expr=route={test,test2}

Who is this feature for?

Developers

Which issue(s) does this PR fix?:

Fixes #

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.

@EduardZaydler EduardZaydler requested a review from a team as a code owner April 26, 2024 06:55
@CLAassistant
Copy link

CLAassistant commented Apr 26, 2024

CLA assistant check
All committers have signed the CLA.

@EduardZaydler EduardZaydler marked this pull request as draft April 26, 2024 07:00
@EduardZaydler EduardZaydler changed the title Graphite: spilitting expressions in tag_value with template variables Graphite: fix spilitting expressions in tag_value with template variables Apr 26, 2024
@EduardZaydler EduardZaydler marked this pull request as ready for review April 26, 2024 07:13
@EduardZaydler
Copy link
Author

hello, @drew08t , sorry for personal tag, but can you explain me what i`am doing wrong?

@NWRichmond
Copy link
Contributor

NWRichmond commented May 3, 2024

Hi @EduardZaydler! Assuming you mean passing the Changelog Check, the PR title must be formatted as follows:

The pull request title should be formatted according to <Area>: <Summary> (Both "Area" and "Summary" should start with a capital letter).

So to fix, you could change the title to:

Graphite: Fix splitting expressions in tag_value with template variables

@itsmylife itsmylife added this to the 11.1.x milestone May 3, 2024
@itsmylife itsmylife added the no-backport Skip backport of PR label May 3, 2024
@EduardZaydler EduardZaydler changed the title Graphite: fix spilitting expressions in tag_value with template variables Graphite: Fix splitting expressions in tag_value with template variables May 7, 2024
@EduardZaydler
Copy link
Author

Hi @EduardZaydler! Assuming you mean passing the Changelog Check, the PR title must be formatted as follows:

The pull request title should be formatted according to <Area>: <Summary> (Both "Area" and "Summary" should start with a capital letter).

So to fix, you could change the title to:

Graphite: Fix splitting expressions in tag_value with template variables

thanks for the answer, fixed

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

Successfully merging this pull request may close these issues.

None yet

4 participants