Setting Grafana variables

If you go to Settings (in the upper-right corner) and select Variables, we can add a new pod variable:

Besides the name of the variable, we set its type as query to obtain its values from a Prometheus http_request_duration_microseconds_bucket query. We then set /.*pod="([^"]*).*/ as the regex that will extract the pod label value from each observation.

Recall that each Prometheus observation has the format <metric_name>{<lbl1>=<lbl1_val>,<lbl2>=<lbl2_val>,...} <value> <timestamp>.

The pod variable can assume distinct values of the pod label, but because we also selected the Include All option, we may say that the ...

Get Mastering Elixir now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.