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

${__series.name} macro should probably return the same thing as ${__field.displayName} even for frames with more than 1 value field #772

Open
torkelo opened this issue Jun 5, 2024 · 1 comment

Comments

@torkelo
Copy link
Member

torkelo commented Jun 5, 2024

When ${__series.name} is used in a datalink we have a field in the __dataContext, so feels wrong to use getFrameDisplayName in the macro, getFrameDisplayName does return the same thing as getFieldDisplayName for data frames that only have one value field.

But when testing this out now in time series panel the frame that the data links operate on seems to be the joined data frame, so even if the query returns multiple frames the ones the datalinks see is just 1 frame with many value fields, this turns getFrameDisplayName with a fieldIndex just return Series (<n>) instead of the propper field name.

Try it locally with a Prometheus query that, if it returns 1 series ${__series.name} works if it returns 2 it shows up as Series (<n>) , not sure if this is a regression in TimeSeriesPanel that datalinks operator on the joined data frame, this must surely have worked before?

@leeoniya @dprokop thoughts?

@torkelo
Copy link
Member Author

torkelo commented Jun 5, 2024

Root cause of regression, grafana/grafana#83654

but instead of reverting that I think changing ${__series.name} macro could be a good idea (so that it returns the same as ${__field.displayName} when there is a field in the dataContext

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

No branches or pull requests

1 participant