Prometheus HTTP API

The web interface Prometheus offers for running queries and inspecting targets, used by Grafana and by scripts.

In more detail

An instant query is a GET or POST to /api/v1/query with a query and an optional time; the reply is JSON. Grafana's Prometheus data source uses the same API.

Examples

curl -sG --data-urlencode 'query=up' http://localhost:9090/api/v1/query
The course script query.sh wraps it with curl and jq.

Related terms

Taught in

References