Prometheus REST API
Pull-based monitoring system with powerful query language
Prometheus is an open-source monitoring and alerting toolkit designed for reliability and scalability. It collects and stores metrics as time series data, providing a powerful query language (PromQL) for analysis and visualization. Developers use Prometheus to monitor infrastructure, applications, and services with dimensional data modeling and built-in alerting.
http://localhost:9090/api/v1
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /query | Evaluates an instant query at a single point in time. Requires a PromQL expression in the query parameter. |
| GET | /query_range | Evaluates an expression query over a range of time. Accepts start, end, and step parameters to define the time window. |
| GET | /series | Returns the list of time series that match a certain label set |
| GET | /labels | Returns a list of label names. Optionally filtered by start and end time parameters. |
| GET | /label/ | Returns a list of label values for a provided label name. The label_name is specified in the path. |
| GET | /targets | Returns an overview of the current state of the Prometheus target discovery |
| GET | /rules | Returns a list of alerting and recording rules. Includes rule groups, evaluation times, and health status. |
| GET | /alerts | Returns a list of all active alerts. Includes alert state, labels, annotations, and firing duration. |
| GET | /alertmanagers | Returns an overview of the current state of the Prometheus alertmanager discovery |
| GET | /status/config | Returns the current Prometheus configuration. Includes the YAML config as loaded at startup. |
| GET | /status/flags | Returns the flag values that Prometheus was configured with. Shows command-line flags and their current values. |
| GET | /status/runtimeinfo | Returns runtime information about the Prometheus server. Includes startup time, storage retention, and Go runtime details. |
| GET | /metadata | Returns metadata about metrics currently scraped from targets |
| POST | /admin/tsdb/snapshot | Creates a snapshot of all current data into a subdirectory. Returns the snapshot directory name for backup purposes. |
| POST | /admin/tsdb/delete_series | Deletes data for a selection of series in a time range. Requires match[] selectors and optional start/end timestamps. |
Sponsor this page
AvailableReach developers actively building with Prometheus. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
curl -G 'http://localhost:9090/api/v1/query' \
--data-urlencode 'query=up' \
--data-urlencode 'time=2024-01-15T10:30:00.000Z' \
-u 'admin:password'
Use Prometheus from Claude / Cursor / ChatGPT
Prometheus is a self-hosted protocol — it lives on a host you operate (default http://localhost:9090/api/v1). A
hosted MCP gateway can't reach localhost on your machine, so the usual one-click setup doesn't apply.
These are the tools an MCP for Prometheus would expose:
query_prometheus_metrics
Execute PromQL queries to retrieve current metric values and analyze system health
get_metric_history
Query time-series data over a range to analyze trends and patterns in metrics
list_active_alerts
Retrieve all currently firing alerts with their labels and annotations
discover_targets
Get the current status of all monitored targets and their health state
analyze_metric_cardinality
Examine metric labels and cardinality to optimize monitoring performance
Run an Prometheus MCP locally
The local-CLI version of these tools is on the way (npx @meru/rest-mcp --vendor=prometheus · BYO connection string · zero secrets sent to us). For now use the patterns below in your own MCP server, or self-host one from the IOX templates.