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

# Connect Grafana Loki to Corunner for Log Investigation

> Investigate production logs with Grafana Loki. Corunner reads logs, discovers labels, and generates evidence links for incident debugging.

Grafana Loki is a Direct Connection that lets Corunner investigate production logs. Once connected, the Debug/Diagnostics Agent can query logs, discover the labels available in your Loki setup, and generate evidence links you can paste back into a Slack or Teams thread.

## What Corunner does with Grafana Loki

Agents run log queries when investigating incidents, discover which labels are available so queries stay in scope, and produce evidence links that let humans open Grafana with the exact query pre-loaded.

## What you get

* Read logs
* Discover labels
* Generate evidence links

## Authentication

Authentication depends on the connection mode. Grafana Cloud uses a bearer token. A self-hosted Grafana instance supports a bearer token or basic authentication. A direct Loki connection supports no authentication, a bearer token, or basic authentication.

## What breaks if you disconnect

* Log investigation
* Incident evidence

## Manage this connection

Open **Integrations** in the Corunner web app, then find **Grafana Loki** under the **Direct Connections** tab.

## Connect Grafana Loki

Open the **Connect Grafana Loki** dialog and choose the mode that matches your deployment.

### 1. Grafana Cloud

Choose **Grafana Cloud**, then enter a connection name, environment, Grafana URL, Loki datasource UID, and bearer token. Add a tenant header only if your Grafana Cloud configuration requires one.

<Frame caption="Configure a Grafana Cloud connection in Corunner.">
  <img src="https://mintcdn.com/corunner/-NGnd1AYR_uoFw_T/images/integrations/direct/grafanLoki/grafanLoki.png?fit=max&auto=format&n=-NGnd1AYR_uoFw_T&q=85&s=50c28dec6746b004875da74e9a656abd" alt="Connect Grafana Loki dialog with Grafana Cloud selected and fields for the Grafana URL, datasource UID, bearer token, and optional tenant header" width="648" height="796" data-path="images/integrations/direct/grafanLoki/grafanLoki.png" />
</Frame>

### 2. Self-hosted

Choose **Self-hosted**, then enter a connection name, environment, Grafana URL, and Loki datasource UID. Select **Bearer token** or **Basic auth** and provide the matching credentials. Add a tenant header only when your deployment uses one.

<Frame caption="Configure a self-hosted Grafana connection and select its authentication method.">
  <img src="https://mintcdn.com/corunner/-NGnd1AYR_uoFw_T/images/integrations/direct/grafanLoki/grafanLoki1.png?fit=max&auto=format&n=-NGnd1AYR_uoFw_T&q=85&s=4a29cf3d93b10cda6107302dcb47eba7" alt="Connect Grafana Loki dialog with Self-hosted and Bearer token selected" width="628" height="790" data-path="images/integrations/direct/grafanLoki/grafanLoki1.png" />
</Frame>

### 3. Direct Loki

Choose **Direct Loki** when Corunner should connect to the Loki endpoint without going through Grafana. Enter a connection name, environment, and Loki URL. Then select **No auth**, **Bearer token**, or **Basic auth** to match your Loki deployment.

<Frame caption="Configure a direct connection to a Loki endpoint.">
  <img src="https://mintcdn.com/corunner/-NGnd1AYR_uoFw_T/images/integrations/direct/grafanLoki/grafanLoki2.png?fit=max&auto=format&n=-NGnd1AYR_uoFw_T&q=85&s=e47eae8df56d335284610c08b1ccf3f5" alt="Connect Grafana Loki dialog with Direct Loki selected, a Loki URL field, authentication options, and a tenant header field" width="649" height="793" data-path="images/integrations/direct/grafanLoki/grafanLoki2.png" />
</Frame>

The **Tenant header** is optional. Leave it empty unless your Loki deployment uses tenant-based isolation and requires a tenant identifier with each request.

After completing the fields for your selected mode, click **Connect**. Corunner verifies the endpoint and credentials before saving the connection.
