Grafana
Connect your Grafana instance to enable CloudThinker agents to access dashboards, query metrics, and reference visualizations during analysis.Supported Platforms
| Platform | Support |
|---|---|
| Grafana OSS | 9.x, 10.x |
| Grafana Enterprise | All versions |
| Grafana Cloud | All tiers |
Setup
1
Open Grafana
Navigate to your Grafana instance and sign in with admin access.
2
Navigate to Service Accounts
Go to Administration → Users and access → Service Accounts.
3
Create Service Account
Click Add service account and enter:
- Name:
cloudthinker-readonly - Role: Select Viewer
4
Generate Token
On your new service account page:
- Click Add service account token
- Enter a token name (e.g.,
cloudthinker-token) - Optionally set an expiration date
- Click Generate token
- Immediately copy the token (it won’t be shown again)
5
Add Connection in CloudThinker
Navigate to Connections → Grafana and enter:
- Grafana URL: Your instance URL (e.g.,
https://grafana.your-domain.com) - Service Account Token: The token you just copied
Connection Details
| Field | Description | Example |
|---|---|---|
| GRAFANA_URL | Your Grafana instance URL | https://your-instance.grafana.net |
| GRAFANA_SERVICE_ACCOUNT_TOKEN | The generated service account token | glsa_xxxxx... |
Required Permissions
Minimum (Viewer Role)
- View dashboards
- Query data sources
- View annotations
- Access folder contents
Recommended (Editor Role)
All Viewer permissions, plus:- Create annotations
- Save dashboard snapshots
Agent Capabilities
Once connected, agents can:| Capability | Description |
|---|---|
| Dashboard Access | Reference existing dashboards in analysis |
| Metric Queries | Query data sources through Grafana |
| Annotation Reading | Access dashboard annotations for context |
| Alert Status | Check Grafana alerting rules status |
Example Prompts
Supported Data Sources
CloudThinker can query through Grafana’s configured data sources:| Data Source | Query Support |
|---|---|
| Prometheus | PromQL queries |
| InfluxDB | InfluxQL / Flux |
| Elasticsearch | Lucene / KQL |
| CloudWatch | CloudWatch metrics |
| Loki | LogQL queries |
Troubleshooting
Connection failed
Connection failed
- Verify Grafana URL is accessible
- Check SSL certificate is valid
- Ensure no proxy is blocking the connection
- Confirm Grafana is running
Authentication failed
Authentication failed
- Verify service account token is correct
- Check token hasn’t expired
- Ensure service account is active
- Confirm no IP restrictions on the account
Token expired
Token expired
- Navigate to Administration → Service Accounts
- Select the CloudThinker service account
- Generate a new token
- Update the token in CloudThinker connection settings
Cannot access dashboards
Cannot access dashboards
- Verify service account has Viewer role
- Check folder permissions include the service account
- Ensure dashboards aren’t in restricted folders
Security Best Practices
- Viewer role only - Never grant Editor or Admin roles
- Token expiration - Set appropriate expiration on tokens
- Token rotation - Rotate tokens every 90 days
- IP restrictions - Consider limiting access to CloudThinker IPs
- Audit logs - Enable Grafana audit logging