admission-control
Use when the user asks to "write a validator", "add validation", "implement admission…
Set up Grafana Cloud Database Observability for MySQL and PostgreSQL — enables `pg_stat_statements` / Performance Schema, creates a least-privilege monitoring user, configures the `database_observability.postgres` / `database_observability.mysql` Alloy components, ships query
$ npx -y skills add grafana/skills --skill database-observability --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/database-observabilityContext preview
The summary Claude sees to decide when to auto-load this skill.
Set up Grafana Cloud Database Observability for MySQL and PostgreSQL — enables `pg_stat_statements` / Performance Schema, creates a least-privilege monitoring user, configures the `database_observability.postgres` / `database_observability.mysql` Alloy components, ships query
name: database-observability license: Apache-2.0 description: Set up Grafana Cloud Database Observability for MySQL and PostgreSQL — enables `pg_stat_statements` / Performance Schema, creates a least-privilege monitoring user, configures the `database_observability.postgres` / `database_observability.mysql` Alloy components, ships query samples + visual explain plans + RED metrics + schema details to Grafana Cloud, and correlates slow queries with application traces via `db.statement` / `db.system` OTel attributes. Use when monitoring database performance, diagnosing slow queries, setting up DB observability for RDS / Aurora / Cloud SQL / Azure Database / self-managed instances, correlating DB metrics with APM, or alerting on query latency — even when the user says "my database is slow", "find the slow queries", or "monitor RDS" without saying "observability".
> **Docs**: https://grafana.com/docs/grafana-cloud/monitor-applications/database-observability/
Query-level insights (RED metrics, query samples, explain plans) for MySQL and PostgreSQL without application code changes. GA since April 2026.
-- 1. Enable pg_stat_statements (requires restart) -- In postgresql.conf: shared_preload_libraries = 'pg_stat_statements' -- Then restart PostgreSQL. -- 2. Create a least-privilege monitoring user CREATE USER grafana_monitoring WITH PASSWORD 'secret'; GRANT pg_monitor TO grafana_monitoring; GRANT CONNECT ON DATABASE mydb TO grafana_monitoring; -- 3. Enable the extension on each monitored DB CREATE EXTENSION IF NOT EXISTS pg_stat_statements; -- 4. Verify SELECT count(*) FROM pg_stat_statements; -- Should return >= 0 (not an error). If "relation does not exist": step 3 didn't run.
5. Add the [Alloy config block from references/alloy-config.md § PostgreSQL](references/alloy-config.md#postgresql) 6. Restart Alloy and wait ~60s for first scrape 7. **Verify in Grafana Cloud** → Database Observability — the instance should appear with non-empty `db_query_total{db_instance="mydb"}` series. If empty after 2 minutes: check Alloy logs for connection errors, then re-verify pg_stat_statements permissions.
-- 1. Create least-privilege monitoring user CREATE USER 'grafana_monitoring'@'%' IDENTIFIED BY 'secret'; GRANT SELECT, PROCESS, REPLICATION CLIENT ON *.* TO 'grafana_monitoring'@'%'; GRANT SELECT ON performance_schema.* TO 'grafana_monitoring'@'%'; FLUSH PRIVILEGES; -- 2. Verify performance_schema is enabled (default in MySQL 8+) SELECT @@performance_schema; -- Returns 1 → enabled. 0 → set performance_schema=ON in my.cnf + restart.
3. Add the [Alloy config block from references/alloy-config.md § MySQL](references/alloy-config.md#mysql) 4. Restart Alloy, wait ~60s, verify the instance appears in Grafana Cloud → Database Observability
| Database | Variants | |----------|---------| | **MySQL** | Self-managed, RDS MySQL, Aurora MySQL, Cloud SQL MySQL, Azure Database for MySQL | | **PostgreSQL** | Self-managed, RDS PostgreSQL, Aurora PostgreSQL, Cloud SQL PostgreSQL, Azure Database for PostgreSQL |
For managed databases (RDS / Cloud SQL / Azure), `pg_stat_statements` is preinstalled but disabled — enable it via the parameter group / flag, then re-create the extension at the DB level.
Public skills for working with Grafana, Prometheus, Loki, Tempo, Pyroscope, k6, and the broader LGTM observability stack. Compatible with Claude Code, Cursor, Codex, and any tool supporting the Agent Skills open standard.
Repo: grafana/skills
Use when the user asks to "write a validator", "add validation", "implement admission…
Use when starting any grafana-app-sdk work — scaffolding a Grafana app, initializing a…
Author CUE kind definitions for grafana-app-sdk apps - schemas, versioning, field…
Implement reconcilers and watchers for grafana-app-sdk apps — write…
Cut Grafana Cloud Metrics cost by shrinking active-series count with Adaptive Metrics…