Skip to content

Metrics

The MCP server supports querying Prometheus-compatible metrics using PromQL. Use these tools to retrieve time-series data, explore label metadata, and monitor service behavior in real time.

Instant metric query

Run a PromQL expression at a single point in time using the metrics__instant_query tool.

Example:

{
  "query": "up{job=\"api\"}",
  "limit": 10
}

Parameters:
NameDescription
queryA valid PromQL expression to evaluate at a single point in time.
limitMaximum number of time-series to return (1–20).
evaluationTime(Optional) RFC-3339 timestamp (UTC) to evaluate the query at a specific time. Defaults to current time if omitted.

Range metric query

Run a PromQL expression across a time window using the metrics__range_query tool.

Example:

{
  "query": "cpu_usage_percent",
  "start": "2024-01-15T10:00:00Z",
  "end": "2024-01-15T11:00:00Z",
  "step": "1m",
  "limit": 5
}

Parameters:
NameDescription
queryA valid PromQL expression to evaluate over a range of time.
startStart time of the query window (RFC-3339 UTC format).
endEnd time of the query window (RFC-3339 UTC format).
stepInterval between data points, specified as a duration (e.g., 1m, 30s).
limitMaximum number of time-series to return (1–20).

List metric label names

Get all metric label names within a time range using the metrics__labels tool.

Example:

{
  "limit": 10,
  "startDate": "2024-01-15T00:00:00Z",
  "endDate": "2024-01-15T23:59:59Z",
  "match": ["app=\"frontend\""]
}

Parameters:
NameDescription
limitMaximum number of label names to return (1–20).
startDate(Optional) Start of the search range (RFC-3339 UTC). Allows dates up to three months back from the current date.
endDate(Optional) End of the search range (RFC-3339 UTC). Allows dates up to three months back from the current date.
match(Optional) Array of PromQL selector strings to filter results.

List values for a specific label

List possible values for a specific label using the metrics__label_values tool.

Example:

{
  "labelName": "job",
  "limit": 10
}

Parameters:
NameDescription
labelNameThe name of the label to retrieve values for.
limitMaximum number of values to return (1–20).
startDate(Optional) Start of the search range (RFC-3339 UTC). Allows dates up to three months back from the current date.
endDate(Optional) End of the search range (RFC-3339 UTC). Allows dates up to three months back from the current date.
match(Optional) Array of PromQL selector strings to filter results.

List matching metric series

Return all metric series (label sets) matching a selector list using the metrics__series tool.

Example:

{
  "match": ["{job=\"api\"}"],
  "limit": 10
}

Parameters:
NameDescription
matchArray of PromQL selectors used to filter series.
limitMaximum number of series (label sets) to return (1–20).
startDate(Optional) Start of the search range (RFC-3339 UTC). Allows dates up to three months back from the current date.
endDate(Optional) End of the search range (RFC-3339 UTC). Allows dates up to three months back from the current date.