LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

database-observability

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,

199stars17forksUpdated 7/25/2026
Database Management#grafana#database#observability#postgresql#mysql#monitoring

Security Assessment

Safe(93/100)
Security Score93/100

About database-observability

This skill sets up Grafana Cloud Database Observability for MySQL and PostgreSQL, giving query-level insight — RED metrics, sampled query texts, and visual explain plans — without application code changes. It solves the practical problem of diagnosing slow queries and monitoring database performance across self-managed and managed instances (RDS, Aurora, Cloud SQL, Azure Database), including cases where a user simply says "my database is slow" or "monitor RDS".

The skill walks through concrete setup workflows. For PostgreSQL it enables `pg_stat_statements` (via `shared_preload_libraries` and a restart), creates a least-privilege monitoring user granted the `pg_monitor` role and connect rights, and enables the extension per database. For MySQL it creates a least-privilege user with SELECT/PROCESS/REPLICATION CLIENT and performance_schema access, and verifies Performance Schema is on. It then configures the `database_observability.postgres` / `database_observability.mysql` Grafana Alloy components with selectable collectors (pg_stat_statements, query_samples, schema_details, explain_plans), forwarding metrics and logs to Grafana Cloud using credentials pulled from environment variables. Reference files provide the full Alloy config, key PromQL queries, alert-rule YAML for slow queries, error rate, and connection saturation, and trace-correlation setup that links slow spans to specific SQL via OpenTelemetry `db.statement` / `db.system` / `db.name` attributes.

Target users are SREs, DBAs, and platform engineers running MySQL or PostgreSQL who want query-level observability, APM correlation, and latency alerting in Grafana Cloud. This is defensive observability tooling that emphasizes least-privilege access and standard credential handling via environment variables.

FAQ

Which databases and hosting variants are supported?

MySQL and PostgreSQL, across self-managed, RDS, Aurora, Cloud SQL, and Azure Database variants. For managed databases, pg_stat_statements is preinstalled but must be enabled via the parameter group or flag and then re-created at the DB level.

What are the prerequisites?

For PostgreSQL, pg_stat_statements enabled (requires a restart) and a monitoring user with the pg_monitor role. For MySQL, Performance Schema enabled (default in MySQL 8+) and a least-privilege monitoring user. Grafana Alloy is used to ship data to Grafana Cloud.

How are credentials handled?

The Alloy config reads Grafana Cloud endpoints and API keys from environment variables (for example PROMETHEUS_URL, PROMETHEUS_USER, and GRAFANA_CLOUD_API_KEY), and the skill creates a dedicated least-privilege database user rather than reusing an admin account.

Does it require application code changes?

No. Query-level insights are collected at the database and agent layer. Optional APM trace correlation relies on the application's existing OpenTelemetry instrumentation emitting db.statement, db.system, and db.name span attributes.

What can it alert on?

Reference alert rules cover P95 query latency over a threshold, database error rate, and connection-pool saturation, expressed as PromQL-based alerting YAML.

All Files

3 files
references/alloy-config.md1.6 KB
View
references/queries-alerts.md1.8 KB
View
SKILL.md4.3 KB
View

Install database-observability

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

grafana/skills

Related Skills

short-form-video

14

multi-asset-morning-briefing

7,907

content-strategy

2,901

doherty-threshold

2,901