Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Grafana Difficulty: Advanced ClaudeChatGPT

Grafana Usage Insights & Analytics Prompt

Use Grafana Enterprise Usage Insights to find unused dashboards, heavy data sources, and slow queries, then act on the analytics.

Target user
Grafana admins governing large multi-team instances
Difficulty
Advanced
Tools
Claude, ChatGPT

The prompt

You are a senior Grafana platform admin who governs a large Enterprise instance using Usage Insights.

I will provide:
- The scale (dashboards, users, data sources)
- The governance goal (cleanup, cost, performance)
- Access to Usage Insights / analytics

Your job:

1. **Explain the feature**: Usage Insights (Grafana Enterprise/Cloud) tracks dashboard views, unique users, errors, and query performance, exposed via the presence indicator, insights panels, and exported logs.
2. **Find unused dashboards**: sort by views/last-viewed to identify candidates for archiving or deletion.
3. **Spot heavy data sources**: rank by query volume and error rate to find noisy or failing sources.
4. **Slow queries**: use the query performance insights to find dashboards with high load time and optimize them.
5. **Export to Loki**: ship Usage Insights logs to a Loki/analytics datasource so you can build governance dashboards on top.
6. **Presence & errors**: use per-dashboard insights (views, errors, last accessed) to prioritize maintenance.
7. **Act on findings**: archive unused dashboards, add caching, or fix broken data sources.
8. **Automate**: build a governance dashboard and periodic report from the insights data.

Mark DESTRUCTIVE: deleting dashboards flagged "unused" without confirming ownership, disabling data sources still referenced, purging insights logs prematurely.

---

Scale: [DESCRIBE]
Governance goal: [DESCRIBE]
Insights access: [DESCRIBE]

Why this prompt works

At scale, Grafana instances rot — thousands of dashboards, most unviewed, some querying failing data sources. Usage Insights gives the data to fix that, but the naive move (delete everything unviewed) removes critical incident boards. This prompt pairs the analytics with a safe, ownership-aware remediation path.

How to use it

  1. State the instance scale so the assistant frames realistic thresholds.
  2. Pick the goal — cleanup, cost, or performance — to focus the analysis.
  3. Confirm Enterprise/Cloud so it doesn’t suggest an OSS-unavailable feature.
  4. Ask for a governance dashboard and report built on exported insights.

Useful commands

# Per-dashboard usage insights (Enterprise API)
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
  "http://localhost:3000/api/dashboards/uid/mydash" | jq '.meta'

# Search dashboards to cross-reference with insights views
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
  "http://localhost:3000/api/search?type=dash-db&limit=5000" \
  | jq '.[] | {uid, title, folderTitle}'

Example config

# grafana.ini — enable Usage Insights export to Loki
[analytics.summaries]
buffer_write_interval = 30s

[usage_insights.export]
enabled = true

[usage_insights.export.logs]
datasource = insights-loki
# Loki: rank dashboards by views over the last 30 days (from exported insights)
sum by (dashboardName) (
  count_over_time({datasource="insights"} | json | eventName="dashboard-view" [30d])
)

Common findings this catches

  • Dashboard sprawl → many boards with zero recent views.
  • False positives → seasonal/incident boards flagged unused.
  • Failing sources → data source with high error rate.
  • Slow dashboards → high load time from unoptimized queries.
  • OSS gap → feature unavailable outside Enterprise/Cloud.
  • Privacy exposure → user identifiers in insights logs.
  • Lost audit → insights retention purged too early.

When to escalate

  • Mass dashboard deletion — get team owner sign-off, don’t act unilaterally.
  • Data source deprecation affecting many teams — change-management process.
  • Privacy handling of usage logs — data governance/security.

Related prompts

Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 2,104 DevOps AI prompts
  • One practical workflow email per week