Skip to content

Drilldown url#1

Open
Edaurd wants to merge 40 commits into
mainfrom
DrilldownURL
Open

Drilldown url#1
Edaurd wants to merge 40 commits into
mainfrom
DrilldownURL

Conversation

@Edaurd
Copy link
Copy Markdown
Collaborator

@Edaurd Edaurd commented Apr 15, 2024

For Local Reasons

What is this feature?

Implements #1232
As of now users of Prometheus and Loki are able to create custom legend labels based on the labels of the metrics and this pull request adds an option to make those legend labels redirectable to a predefined url which can vary based on the same labels of the metrics, creating whats called a drilldown link.

Why do we need this feature?

It allows user defined drilldown urls within Prometheus and Loki for easier navigation.

Who is this feature for?

For users of the dashboard who would like to navigate between their panels more easily

Which issue(s) does this PR fix?:

Fixes grafana#1232

Notes:

  • This replaces the default functionality of clicking on the label to isolate the item in the graph.

Planned:

  • Make the URL Field only show in Prometheus when Custom is selected
    • Currently it only functions when custom is selected, it does not dissapear when custom is deselcted
  • The idea for a URL Builder is there but unsure how necessary that is.

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.

Visualization:
Prometheus:

  • opened:
    image
  • closed:
    image

Loki:

  • opened:
    image
  • closed
    image

still not able to save even though the code is a copy of the one i had before, still looking into it
i thought i fixed it yesterday morning but aparently i didn't, now i have for sure
[Your New Legend Label with {{job}} variables](https://your.url/{{instance}}/for/example)
getUrl does not seem to be functioning as expected, it is not able to read the LegendUrlFormat from the config file yet
front end wise it seems to be working fine now, we can't know for certain untill we are able to pull form the config in the back end
No longer is this done with a constant and works fully as intended
This commit introduces the necessary backend enhancements to enable drilldown links within Loki. The implementation follows a similar style of converting the url from the datasource as used in Prometheus
Applied the helper function to the formatName to avoid duplicate code
added the required fields to be able to save the url to the config
the current tests were failing due to this implementation, i solved it by changing how its adding the "..." at the end
This is so it wouldn't take too much screen real estate
still not able to save even though the code is a copy of the one i had before, still looking into it
i thought i fixed it yesterday morning but aparently i didn't, now i have for sure
[Your New Legend Label with {{job}} variables](https://your.url/{{instance}}/for/example)
getUrl does not seem to be functioning as expected, it is not able to read the LegendUrlFormat from the config file yet
front end wise it seems to be working fine now, we can't know for certain untill we are able to pull form the config in the back end
No longer is this done with a constant and works fully as intended
This commit introduces the necessary backend enhancements to enable drilldown links within Loki. The implementation follows a similar style of converting the url from the datasource as used in Prometheus
Applied the helper function to the formatName to avoid duplicate code
added the required fields to be able to save the url to the config
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

Successfully merging this pull request may close these issues.

Feature Request: Add per metric (Drilldown) link to add another variable to a Drilldown graph link

1 participant