Grafana
Give an agent access to Grafana, Loki and Tempo with a service account token.
Required permissions
list_loki_label_names
query api access
List all label names (keys) found in logs in a Loki datasource and time range. Defaults to the last hour.
list_loki_label_values
query api access
List the unique values of a given label in a Loki datasource. Useful for discovering filter options.
query_loki_logs
query api access
Query and retrieve log entries from a Loki datasource using label filters. Returns log lines with timestamps and labels.
search_dashboards
dashboards.permissions:read
Search Grafana dashboards to find the ones whose graphs might be relevant to the current alert.
list_dashboards
dashboards.permissions:read
List dashboards in a given namespace, for discovering which graphs exist.
get_dashboard
dashboards.permissions:read
Get a dashboard by name, including its panels with their queries and datasources.
list_tempo_services
query api access
Discover the available service.name values in a Tempo datasource.
search_tempo_traces
query api access
Search Tempo traces for a service and time range, optionally filtered by duration. Returns trace summaries including trace IDs.
get_tempo_trace
query api access
Fetch a single Tempo trace as a compacted span tree with service names, durations, and HTTP context.
Create service account token
Create a Service account token with Viewer role

On the next screen, click on the Add service account token button

On the modal choose "No expiration" and click on the Generate token button

Copy your token and temporarily paste it somewhere secure (e.g. a private note). You will later need the token when setting up the Grafana MCP server in ilert.

Connect Grafana with agent
To connect Grafana with your AI SRE agent:
Navigate to Agents in the ilert navigation menu
Open the agent detail view for the agent you want to configure
Go to the Tools tab
Under the ilert hosted MCP servers section, locate the Grafana card
Click Connect on the Grafana card
In the connection dialog that appears:
Select connector: Choose "Create new connector" (or select an existing connector if you have one)
Type: Select Bearer Token from the dropdown
Secret name: Enter a name for your connector (e.g., "Grafana Production" or "Grafana Main")
Secret value: Paste the service account token you created earlier
Host URL: Enter your Grafana instance URL (e.g.,
https://grafana.example.com)

Click Connect to complete the connection
After connecting, you can enable or disable specific tools needed for alert investigation, such as:
list_loki_label_names- List available label names in a Loki datasourcelist_loki_label_values- List the values of a given Loki labelquery_loki_logs- Query log entries from a Loki datasourcesearch_dashboards- Search dashboards relevant to the alertlist_dashboards- List dashboards in a namespaceget_dashboard- Get a dashboard with its queries and datasourceslist_tempo_services- Discover services in a Tempo datasourcesearch_tempo_traces- Search traces for a service and time rangeget_tempo_trace- Fetch a single trace as a span tree
The Grafana integration is now connected and ready to use for root cause analysis.
Last updated
Was this helpful?