> ## 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.

# Adopt: connect your stack

> A guide to connecting your own infrastructure

This guide walks you through connecting sureops to your real infrastructure. By the end, sureops agents will be watching your services, diagnosing incidents from your telemetry, and proposing code fixes as pull requests in your GitHub repos.

This page is a connection guide, not a step-by-step wizard — for the full numbered onboarding tour (including the demo path), see [Guided onboarding journey](https://docs.sureops.ai/onboarding/guided-onboarding-journey.md).

> [!NOTE]
>
> You are in early access. If you get stuck, open **Help & support** in the sidebar and use **Email us** or **Ping us on Slack** — we aim to respond within one business hour during business hours. Hands-on, in-your-environment co-implementation support from a sureops field engineer is planned for higher tiers, but isn't a generally available self-serve feature yet.

## Before you start

Have these ready before beginning:

| Item | Why |
| - | - |
| **An AI model / LLM API key (BYOK)** | Required before agents can diagnose any incident — agents cannot analyze telemetry without a configured model. Connect this early; it is a prerequisite for later steps, not an afterthought |
| **A dedicated knowledge-base (KB) repo** | sureops stores your service contract (`.sureops/services.yaml`) in one dedicated KB repo per organization — never in your service source repos. Pick an existing empty repo or create a new one before you start writing contract files. You'll designate it in **Settings → Organization → Knowledge Base** once GitHub is connected |
| **Prometheus URL + auth token**, or a **Grafana URL + service account token** | Used to configure `prometheus-mcp` or `grafana-mcp` — a small MCP proxy you stand up yourself. sureops never receives your Prometheus/Grafana URL or credentials directly, only the MCP endpoint URL and a bearer token. For Grafana that is the token `grafana-mcp` expects; `prometheus-mcp` has no token of its own, so for Prometheus it is the token of the ingress or proxy you put in front of it |
| **A GitHub organization owner** | Needed to approve the sureops GitHub App install, which lets sureops read repos and open fix PRs |
| **Slack workspace admin** (or permission to install apps) | Required to create incident war-rooms and post agent updates |
| **`kube-state-metrics` with pod-label allowlist** (recommended) | Improves service discovery fidelity — sureops correlates deployments to services via `app.kubernetes.io/name` |
| **OTel collector with `servicegraph` connector** (recommended) | Generates `traces_service_graph_request_total` so sureops can derive your service call graph |

## Connecting your stack

**1. Create your environment**

An environment is the scope for everything sureops does — telemetry connections, incident history, agent configuration, and alert routing are all tied to one environment.

1. Go to **Settings → Organization → Environments → Create environment**
2. Give it a name that matches your deployment context (e.g., `production`, `staging`)
3. Click **Create environment**

During the private beta, each organization can connect one environment of its own, on every plan. A sample (demo) environment you deployed first doesn't count toward that.

**2. Connect your AI model**

sureops agents need a configured AI model before they can diagnose incidents, draft runbooks, or propose fixes.

1. Go to **Settings → Environment → AI Agents**
2. Provide your own API key (BYOK)

You can skip this step and come back to it, but agents cannot diagnose incidents until a model is connected.

**3. Connect your observability stack**

sureops needs access to your observability data to discover services, understand topology, and diagnose incidents.

**Option A — Prometheus (`prometheus-mcp`)**
A Prometheus connection on its own is enough to populate your landscape — you don't need Grafana as well.

1. Stand up [`prometheus-mcp`](https://docs.sureops.ai/integrations/prometheus) — a small MCP proxy pointed at your Prometheus instance. Your Prometheus URL and credentials configure this proxy directly; they are never entered into sureops. It must expose an instant-query tool (`execute_query` from [pab1it0/prometheus-mcp-server](https://github.com/pab1it0/prometheus-mcp-server), with or without a `TOOL_PREFIX` prefix, or `prometheus_query`), and run with `PROMETHEUS_MCP_SERVER_TRANSPORT=http`, `PROMETHEUS_MCP_STATELESS_HTTP=true` (otherwise each sync leaves idle sessions open on the server) and `PROMETHEUS_DISABLE_LINKS=true` (otherwise every query result carries a link to your Prometheus URL). With the `http` transport the Docker image binds `0.0.0.0:8080`; outside Docker also set `PROMETHEUS_MCP_BIND_HOST=0.0.0.0`. Its endpoint ends in `/mcp`
2. `prometheus-mcp` has no built-in authentication, so put it behind an ingress or reverse proxy that checks a bearer token
3. Go to **Settings → Environment → Integrations → Prometheus → Connect**
4. Fill in the **MCP Server Endpoint** (the public `prometheus-mcp` URL) and the **Bearer Token** your ingress or proxy checks — Grafana, Prometheus, Loki, Tempo and Kubernetes always authenticate with a bearer token, so there is no method to choose
5. Click **Save & Connect**
6. Once connected, go to **Settings → Environment → Landscape** and click **Re-sync now** to run the initial service discovery

**Option B — Grafana (`grafana-mcp`)**
Recommended if you already run Grafana: sureops queries your Prometheus through your Grafana instance.

1. Stand up [`grafana-mcp`](https://docs.sureops.ai/integrations/grafana) pointed at your Grafana instance, using a service account token. **Viewer** is sufficient for read-only metric/log queries (unless your Grafana restricts data source permissions; then grant the service account access to the data sources it should query). If you plan to use [Proposed Monitor Export](https://docs.sureops.ai/getting-started/pricing-and-tiers.md) (Growth plan and above) to push approved monitors into Grafana as alert rules, the token must be able to write alert rules through Grafana's provisioning API: **Editor** or above on Grafana 11 and later, or **Admin** (the `alert.provisioning:write` permission) on Grafana 9–10. This token configures `grafana-mcp`; it is never entered into sureops
2. Go to **Settings → Environment → Integrations → Grafana → Connect**
3. Fill in the **MCP Server Endpoint** (your `grafana-mcp` URL) and paste the token `grafana-mcp` expects into **Bearer Token** — this is how sureops authenticates to `grafana-mcp`, not your Grafana credentials
4. Click **Save & Connect**
5. Once connected, go to **Settings → Environment → Landscape** and click **Re-sync now**

If both Prometheus and Grafana are connected, sureops uses Prometheus for landscape discovery, and falls back to Grafana whenever `prometheus-mcp` is unreachable, rejects the token, lacks the instant-query tool, or cannot run a test query. The fallback is silent: if a broken `prometheus-mcp` still leaves a populated landscape, check it by re-syncing with Grafana disconnected.

**What "done" looks like:** Settings → Environment → Landscape shows your service nodes and deployments.

**Common issues:**

* `401 Unauthorized` — the token sureops sends to your MCP server is wrong, or the MCP server's own upstream Prometheus/Grafana credentials are wrong or expired
* `exposes no instant-query tool` — your `prometheus-mcp` doesn't offer `execute_query`, `<prefix>_execute_query` or `prometheus_query`; use a version that does
* `Connection timed out` — your `prometheus-mcp`/`grafana-mcp` server is not reachable from sureops, or your Prometheus/Grafana instance is not reachable from the MCP server. Only the MCP server's endpoint has to be reachable from sureops; your Prometheus or Grafana only has to be reachable from the MCP server
* `0 services discovered` — enable the `kube-state-metrics` pod-label allowlist (`kubeStateMetrics.metricLabelsAllowlist: [pods=[*]]` in your `kube-prometheus-stack` values) and re-sync

**4. Connect Slack**

sureops creates a dedicated Slack war-room channel for each qualifying incident (P1/P2 by default), posts agent updates there, and posts approval requests there for your team.

1. Go to **Settings → Environment → Integrations → Slack → Connect**
2. Authorize the sureops Slack app on your workspace

By default, incident channels are named with an `inc-` prefix. To change the channel prefix, go to **Settings → Environment → Channels** — this is a separate setting from the Slack connect flow itself.

**What "done" looks like:** The Slack integration shows "Connected" in Settings. When the next incident fires, sureops creates a channel and posts the initial alert context automatically.

**5. Connect GitHub**

GitHub integration enables two things: sureops reads your `.sureops/` service contract from your KB repo, and the resolution agent opens draft fix PRs against your service repos.

GitHub connects through the **sureops GitHub App** — sureops runs the GitHub MCP server itself, so there's nothing for you to stand up. During the private beta, **sureops sets this up for you**: tell your onboarding contact (or [hello@sureops.ai](mailto:hello@sureops.ai)) which GitHub organization agents should work in, and an owner of that organization approves the install link we send.

During the private beta, sureops merges the PRs agents open for you by default: incident fix PRs only after you approve them, and Problem Record revert PRs, postmortem PRs, and runbook PRs as soon as they open (if a merge fails, the PR stays open for you). sureops never merges two kinds: a Problem Record fix-plan PR, which stays open for your team to implement, and an incident fix PR containing newly written code, which always stays a draft for you to merge. If you'd rather review and merge them yourself, see [Guided onboarding journey](https://docs.sureops.ai/onboarding/guided-onboarding-journey.md).

> [!WARNING]
>
> There's no GitHub connect form in **Settings → Environment → Integrations** — opening GitHub there shows a notice that sureops sets it up for you. A GitHub connection that has no App installation behind it shows "Agent GitHub tools are off for this connection", and agents skip it. See [GitHub](https://docs.sureops.ai/integrations/github.md).

Once the App is installed, tag any service repo you want sureops to actively watch with the GitHub topic `sureops-service`.

**What "done" looks like:** Settings → Environment → Integrations → GitHub shows "Connected", set up by sureops through the App install.

**Common issues:**

* `No repos with sureops-service topic` — add the topic to at least one repository, then go to **Settings → Environment → Landscape** and click **Re-sync now**

**6. Add your .sureops/ service contract**

The service contract is a YAML file that tells sureops what you know about your services that telemetry alone cannot infer: who owns each service, where its source lives, and where its runbook lives. Agents read this contract before every incident to understand blast radius and who to involve.

The contract lives in your dedicated **KB repo** (the repo you picked in the prerequisites above) — never in a service's own source repo. sureops supports one KB repo per organization. Designate which repo is your KB repo in **Settings → Organization → Knowledge Base** — this org-scoped tab is also where you generate the contract.

**Auto-generate (recommended for getting started):**

1. Go to **Settings → Organization → Knowledge Base → Generate starter contract** (labelled **Regenerate starter contract** once a contract or starter PR exists)
2. sureops fills a draft `.sureops/services.yaml` from the first of these that has services: a Backstage catalog you supply, services already in your landscape, or your GitHub installation's repos — or an empty starter if none do. No AI model call is made. It then opens a draft PR against your KB repo
3. Review the PR — check owners and runbook paths — mark it ready for review, and merge

If `.sureops/services.yaml` is already on your KB repo's base branch, or a starter PR is already open, no new PR is opened — the confirmation links to the existing file or PR.

Already using Backstage? sureops can read your `catalog-info.yaml` directly as a one-shot import instead of generating a contract from scratch — on the same page, open **Advanced: import from Backstage** → **Import from Backstage** to seed the starter contract from your catalog once.

**Hand-author:**
Create `.sureops/services.yaml` in the root of your KB repo. The only required fields per service are `name` and `git_repo`; everything else is optional:

```yaml theme={null}
version: 1
services:
  - name: checkout-service
    git_repo: your-org/checkout-service
    owner: payments-team
    runbook: .sureops/runbooks/checkout-service.md
    tags:
      - tier-1
    depends_on:
      - payment-service
      - inventory-service
```

**What "done" looks like:** At least one service in Settings → Environment → Landscape shows provenance `Customer contract`.

## After you connect

Once you've connected your stack:

1. **Route your alerts to sureops** — there's no self-serve alert-routing connect flow for the adopt path yet. Tell your sureops onboarding contact which alert source you use; they'll set up the webhook registration on your environment so alerts open incidents automatically.
2. **Trigger a test incident** — scale a non-production service to zero replicas and watch the full lifecycle run.

## Trust and data principles

sureops's primary data model is derived structure: service names, dependency edges, and ownership, plus root cause findings, recommendations, and timeline entries written into the incident record. Agents pull raw telemetry (logs, traces, metric series) on demand during an incident to reason through it. See [How integrations work](https://docs.sureops.ai/integrations/how-integrations-work.md) for what agents do with telemetry during an incident.

Your authored service contract always overrides anything sureops infers from telemetry.

## Getting help

If you get stuck:

1. Open **Help & support** from the sidebar and choose **Email us** (opens a pre-filled email to `hello@sureops.ai`) or **Ping us on Slack** (copies your context to paste into the shared Slack support channel)
2. If a provisioning step itself fails, look for a **Contact support** button on the failure banner in **Settings → Environment** — it carries the relevant event log straight to support

Hands-on co-implementation — a sureops field engineer debugging your setup directly in your environment — is planned as a higher-tier offering, not something every plan can self-serve today. For now, the channels above are how to get help.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.