> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sureops.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prometheus

> Connect Prometheus directly for PromQL metric queries during diagnosis and verification

The Prometheus integration gives sureops agents direct access to your Prometheus instance for PromQL queries — used during diagnosis to surface error rate trends, latency spikes, and service health metrics, and during verification to confirm that metrics have returned to baseline after a fix.

<Note>
  If your Prometheus is already configured as a Grafana datasource, you likely **do not need this integration** — the [Grafana integration](/next/integrations/grafana) covers Prometheus queries through a single MCP server. Connect Prometheus directly only if you run Prometheus standalone without Grafana, or if your Prometheus is not reachable through your Grafana instance.
</Note>

***

## What this integration enables

* **PromQL queries** — agents run arbitrary PromQL against your Prometheus for metric diagnosis and verification
* **Service health checks** — agents evaluate `up`, `kube_pod_status_ready`, `kube_deployment_replicas_available`, and similar series during incident investigation
* **Alert correlation** — agents can query the metrics that triggered an alert to understand trend context

***

## Prerequisites

* A running Prometheus instance reachable from your network
* The `prometheus-mcp` server running and reachable from sureops
* Optional: bearer token or basic auth credentials if your Prometheus instance requires authentication

***

## Setup

<Steps>
  <Step title="Stand up prometheus-mcp">
    Deploy `prometheus-mcp` pointed at your Prometheus base URL. If you're using the sureops demo environment, `prometheus-mcp` is already provisioned in-cluster — you can skip this step.

    For your own environment, deploy `prometheus-mcp` with your Prometheus URL and any required auth credentials. The sureops MCP setup guide has Helm and Docker Compose examples.
  </Step>

  <Step title="Enter Prometheus URL and auth">
    In sureops, go to **Settings → Integrations** and click **Connect** next to Prometheus.

    Fill in:

    * **Prometheus URL** — the base URL of your Prometheus instance (e.g. `http://prometheus.svc.cluster.local:9090`)
    * **Auth Method** — one of `none`, `basic`, or `bearer`. Defaults to `none`.
    * **Bearer Token** — only if your Prometheus uses bearer auth
    * **Basic Auth Username / Password** — only if your Prometheus uses basic auth
  </Step>

  <Step title="Enter MCP endpoint">
    Fill in:

    * **Prometheus MCP Endpoint** — the URL of your running `prometheus-mcp` server
    * **MCP Connection Token** — optional bearer token if your MCP server requires its own auth

    Click **Verify connection** to confirm sureops can reach the MCP server and execute a test query.
  </Step>
</Steps>

***

## Required credentials

| Field                   | Required | Description                                 |
| ----------------------- | -------- | ------------------------------------------- |
| Prometheus URL          | Yes      | Base URL of your Prometheus instance        |
| Prometheus MCP Endpoint | Yes      | URL of your running `prometheus-mcp` server |
| Auth Method             | No       | `none` (default), `basic`, or `bearer`      |
| Bearer Token            | No       | Only if your Prometheus uses bearer auth    |
| Basic Auth Username     | No       | Only if your Prometheus uses basic auth     |
| Basic Auth Password     | No       | Only if your Prometheus uses basic auth     |
| MCP Connection Token    | No       | Optional bearer auth for your MCP server    |

***

## Common errors

| Error                  | Fix                                                                                                                             |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| "401 Unauthorized"     | Your Prometheus requires auth but none was provided, or the credentials are wrong. Check the auth method and credentials.       |
| "Connection timed out" | Your `prometheus-mcp` server is not reachable from sureops, or your Prometheus is not reachable from the MCP server.            |
| "0 series returned"    | Your PromQL query is valid but returns no data. Check that `kube_pod_labels` and `kube_state_metrics` series are being scraped. |

***

## Official documentation

* [Prometheus documentation](https://prometheus.io/docs/introduction/overview/)
* [Prometheus HTTP API](https://prometheus.io/docs/prometheus/latest/querying/api/)
