Skip to main content
The Loki integration gives sureops agents access to your Loki instance for LogQL log queries — used during diagnosis to surface relevant log lines, error patterns, and stack traces correlated with an incident’s time window and affected services.
If your Loki is already configured as a Grafana datasource, you likely do not need this integration — the Grafana integration covers Loki log queries through a single MCP server. Connect Loki directly only if you run Loki standalone without Grafana, or if your Loki is not accessible through your Grafana instance.

What this integration enables

  • LogQL queries — agents search log streams for error messages, exception traces, and service-level events during diagnosis
  • Time-window correlation — agents narrow log searches to the incident time window and affected services automatically
  • Multi-tenant support — if you run a multi-tenant Loki, configure the Tenant ID to scope queries to the correct org

Prerequisites

  • An environment selected in the top-right context switcher — Settings → Environment → Integrations is scoped to that environment and stays disabled until one is selected
  • A running Loki instance reachable from your network
  • The loki-mcp server running and reachable from sureops
Integration connections are per-environment. Connecting Loki here only applies to the environment that was selected in the context switcher at the time — it does not carry over to your other environments. Repeat this connect flow for each environment that needs Loki.

Setup

1

Stand up loki-mcp

Deploy an MCP server that speaks LogQL against your Loki instance. If you’re using the sureops demo environment, loki-mcp is already provisioned in-cluster — you can skip this step.For your own environment, deploy your MCP server of choice with your Loki base URL configured as its upstream.
2

Connect in sureops

In sureops, go to Settings → Environment → Integrations and click Connect next to Loki.Fill in:
  • MCP Server Endpoint — the URL of your running loki-mcp server (e.g. https://loki-mcp.internal.company.com/mcp)
  • Authentication Method — Bearer Token, API Key, or Basic Auth, matching how your loki-mcp deployment expects inbound requests to be authenticated
  • Token — labeled Bearer Token, API Key, or Password depending on the method you selected above
Click Save & Connect.
3

Configure Tenant ID (after connecting, if needed)

Once connected, reopen the Loki integration from Settings → Environment → Integrations. If you run a multi-tenant Loki, a Settings section appears below the connection status with a Tenant ID field — set it there, not on the connect form. When set, it’s sent as the X-Scope-OrgID header. There’s no system default — fake is just the value single-tenant Loki commonly expects if it enforces the header at all; don’t type it in unless that’s genuinely your tenant ID. Leave it blank for single-tenant Loki.

Required credentials

Fields collected when you connect the integration: Field configured afterward, via the integration’s Settings section once connected:

Common errors


Official documentation