Back to articles
Prometheus Has a Free Query API That Most Developers Overlook
How-ToDevOps

Prometheus Has a Free Query API That Most Developers Overlook

via Dev.to DevOpsAlex Spinov

Prometheus, the open-source monitoring toolkit, ships with a powerful HTTP API that lets you query metrics, manage alerts, and inspect targets — all without installing extra tools. The PromQL Query API The core endpoint is simple: curl http://localhost:9090/api/v1/query?query = up This returns the current value of the up metric for all targets. But the real power is in range queries: curl "http://localhost:9090/api/v1/query_range?query=rate(http_requests_total[5m])&start=2026-03-29T00:00:00Z&end=2026-03-29T12:00:00Z&step=60s" Key Endpoints You Should Know 1. Instant Query GET /api/v1/query?query=<PromQL>&time=<timestamp> 2. Range Query GET /api/v1/query_range?query=<PromQL>&start=<ts>&end=<ts>&step=<duration> 3. Series Metadata GET /api/v1/series?match[]=<selector> 4. Label Discovery GET /api/v1/labels GET /api/v1/label/<name>/values 5. Targets and Alerts GET /api/v1/targets GET /api/v1/alerts GET /api/v1/rules Building a Custom Dashboard const PROM_URL = " http://localhost:9090 " ; as

Continue reading on Dev.to DevOps

Opens in a new tab

Read Full Article
5 views

Related Articles