“Dashboard anything. Observe everything.”

Overview

Recently I’ve started working in a project heavy focused on observability and monitoring in which the Prometheus configuration and all the Grafana dashboards and alarms were implemented by someone else.

Basically I was blindfolded working with a black-box in terms of application know-how and monitoring perspective.

Foundation

Some important concepts before going further:

Start exploring

Keep in mind that label function doesn’t support queries and isn't a part of Prometheus functions, but a part of Grafana templating (that’s why we created a new dashboard).

We can get all the labels also using Prometheus API endpoint /api/v1/labels:

Conclusions

Grafana and Prometheus are frequently used in organizations, and they’re such a useful monitor-stack because despite the fact that at a certain point we might not know all the implementation details concerning metric collection, they allow us to cast some light using the aforementioned tips.

Grafana

Prometheus API

label_names()

curl -s http://127.0.0.1:9091/api/v1/labels

label_values(<label_name>)

label_values(<metric_name>,<label_name>)

curl -s http://127.0.0.1:9091/api/v1/label/<label_name>/values

up{job="<job_name>"}

curl -s http://127.0.0.1:9091/api/v1/label/job/values