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

# Grafana

> Connect Grafana to Deductive AI to enable reasoning over your grafana data.

## Find your Grafana URL

Locate your Grafana server URL to connect Deductive

1. Open your Grafana instance in a web browser and log in
2. Look at the address bar in your browser - this shows your Grafana URL
3. For self-hosted Grafana: Use your domain (e.g., grafana.example.com)
4. For Grafana Cloud: Use your organization URL (e.g., your-org.grafana.net)
5. Copy only the base domain from the address bar (without https\:// and without any paths like /d/ or /dashboard/)
6. Enter this base domain in the 'Grafana URL' field in Deductive

**Related Documentation**: [View Grafana Setup Documentation](https://grafana.com/docs/grafana/latest/setup-grafana/)

## Service Account Token Setup (Recommended)

Create a service account token for API access

1. As an admin, navigate to \{\{GRAFANA\_URL:/org/users/service-accounts}} ('Administration' → 'Users And Access' → 'Service accounts')
2. Click 'Add service account'
3. Enter a name (e.g., 'Deductive Integration')
4. Assign appropriate role (Editor or Admin recommended for full access)
5. Click 'Create'
6. In the service account, click 'Add service account token'
7. Set token expiration (or no expiration for persistent access)
8. Copy the generated token immediately (starts with glsa\_)

**Related Documentation**: [View Service Account Documentation](https://grafana.com/docs/grafana/latest/administration/service-accounts/)

## API Key Setup (Legacy)

Create an API key for older Grafana versions

1. As an admin, navigate to \{\{GRAFANA\_URL:/org/apikeys}} ('Configuration' → 'API keys')
2. Click 'Add API key'
3. Enter a name for the key
4. Select role (Admin recommended for full access)
5. Set time to live or leave blank for no expiration
6. Click 'Add' and copy the generated key
7. Note: API keys are deprecated in Grafana 9+, use service accounts instead

**Related Documentation**: [View API Keys Documentation](https://grafana.com/docs/grafana/latest/administration/api-keys/)

## Basic Authentication Setup

Use username and password for authentication

1. Ensure basic authentication is enabled in your Grafana configuration
2. Use a user account with appropriate permissions
3. For production, consider creating a dedicated service user
4. Ensure the user has access to required dashboards and alerts

**Related Documentation**: [View Authentication Documentation](https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/)

## Field Reference

The following fields are used when configuring this integration:

* **API Key** (`apiKey`)
* **Grafana URL** (`hostname`)
* **Password** (`password`)
* **Service Account Token** (`serviceAccountToken`)
* **Username** (`username`)
