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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.