@emerald.wunsch
To add a custom value in Grafana Legend, you can use the Templating feature. Here's a step-by-step guide:
- In Grafana, open the Dashboard you want to customize the Legend for.
- Click on the Settings (gear) icon in the top-right corner of the screen.
- From the dropdown menu, select "Templating."
- Click on the "+ New" button to create a new template variable.
- Set the Name for the variable, which will be displayed in the Legend.
- In the Query field, enter a query that will generate the custom value you want to add to the Legend. For example, you may use a Prometheus query or any other data source query to compute a desired value.
- Configure any other options you require, such as a custom Label or Default value for the variable.
- Click on the "Add" button to save the template variable.
- Go back to your Dashboard view.
- Edit the Panel for which you want to show the custom value in the Legend.
- In the Metrics tab, select the Legend format using the "Legend" dropdown option.
- When setting up the Legend format, you can use the newly created template variable as a metric label. Simply add the template variable within curly braces. For example, if your template variable is named "my_variable", you can use the "{my_variable}" placeholder in the Legend format.
- Save the Panel settings.
- Refresh the Dashboard, and you should see your custom value in the Legend.
By using the Templating feature, you can create dynamic custom values in the Legend that will update based on the selected template variable.