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

Correlations: Add links to prometheus dataframe where labels are split out #67736

Merged
merged 1 commit into from May 5, 2023

Conversation

gelicia
Copy link
Contributor

@gelicia gelicia commented May 3, 2023

What is this feature?

When prometheus queries are ran in explore, individual fields are kept in the "labels" section of the data frame except for one dataframe that breaks out the labels for displaying a table. That dataframe gets -Instant appended onto the refId, which causes the datasource lookup to not work and returned undefined.

This adds logic where if the datasource comes back undefined, it checks on if its from a prometheus query and if so, removes the -Instant part of the refID to do the datasource lookup. Then the correlation is added to the dataframe as normal and the data link shows up in the prometheus table.

Why do we need this feature?

So the prometheus explore visualization can show data links.

Who is this feature for?

For enabling correlations with prometheus datasources as the source.

Which issue(s) does this PR fix?:

Fixes #

Special notes for your reviewer:

You will need the 'correlations' feature flag enabled, and a prometheus datasource that is editable.

I would recommend using job as a variable.

Screenshot 2023-05-03 at 9 23 33 AM
Screenshot 2023-05-03 at 9 23 47 AM

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.

@gelicia gelicia requested a review from a team as a code owner May 3, 2023 14:21
@gelicia gelicia requested a review from a team May 3, 2023 14:22
@gtk-grafana gtk-grafana self-requested a review May 3, 2023 14:41
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

Backend code coverage report for PR #67736
No changes

@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

Frontend code coverage report for PR #67736

Plugin Main PR Difference
correlations 92.06% 91.62% -.44%
explore 86.32% 86.32% 0%

Copy link
Contributor

@gtk-grafana gtk-grafana left a comment

Choose a reason for hiding this comment

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

Looks good, can verify that this fixes the linkage in the table view for instant queries vs current functionality in main.

This branch:
image

Main:
image

@Elfo404 Elfo404 added this to the 10.1.x milestone May 5, 2023
@Elfo404 Elfo404 added add to changelog no-backport Skip backport of PR labels May 5, 2023
@gelicia gelicia merged commit 8016214 into main May 5, 2023
23 of 24 checks passed
@gelicia gelicia deleted the kristina/correlations-prometheus branch May 5, 2023 15:25
@ricky-undeadcoders ricky-undeadcoders modified the milestones: 10.1.x, 10.1.0 Aug 1, 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.

None yet

5 participants