I am having trouble getting templates to work with regex in the series override.
The goal is to have a graph that has lines hidden (line width 0) and be able to make them visible (line width 1+) using a template drop down.
- Using Prometheus datasources
- Multiple datasources (ex.
- Each datasource in a datasource template variable
My current approach:
- On the metrics tab, each query will have a different datasource and will have the datasource in the legend
- By default the lines will have a width of 0 (making them look hidden)
- Select the datasource we want visible in the template drop down
- Use the template variable in series overrides to make the line width 1 (visible)
As you can see in the screen shot above, the override works as expected when I use a hard coded site value (ex.
SiteA), but does not work when using the template variable (ex.
SiteB that is selected in the drop down at the top of the screen).
- In the series overrides, is the template value evaluated before the regex expression (ex.
/$SitesToShow/is changed to
/SiteB/before evaluating the regex expression)?
- Is there an issue with my regex expression?
- Is there an easier/another approach to accomplish the same goal?