database-observability

Diagnoses MySQL and PostgreSQL query performance via visual explain plans and metrics.

213|18|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/grafana/skills --skill database-observability
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-observability
Source: https://github.com/grafana/skills/tree/main/skills/grafana-cloud/database-observability
Command: npx skills add https://github.com/grafana/skills --skill database-observability

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database performance is often opaque at the query level, making it difficult to find slow queries, understand root causes, and correlate database behavior with application traces; this Skill surfaces query samples, RED metrics, and visual explain plans to pinpoint and diagnose performance issues.

Core Features & Use Cases

  • Query performance dashboard: Auto-provisioned views for top queries by total time, call count, and mean latency.
  • Query samples & explain plans: Capture actual query parameters, timing, and visual explain plans to identify index usage and scan types.
  • RED metrics & alerts: Per-query RED metrics, Prometheus alert rules for slow queries, high error rates, and connection saturation.
  • Trace correlation: Link db.statement and OTel attributes to application traces to trace slow queries back to services and requests.
  • Deployment scenarios: Works with PostgreSQL and MySQL across self-managed and cloud variants (RDS, Aurora, Cloud SQL, Azure).

Quick Start

Enable pg_stat_statements or MySQL Performance Schema, create a least-privilege monitoring user, add the appropriate database_observability.* block to your Alloy configuration to forward metrics and logs, and verify the Database Observability dashboard appears in Grafana Cloud.

Frequently Asked Questions about database-observability

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I visualize slow query performance in PostgreSQL and MySQL?

To set up database observability, enable pg_stat_statements or MySQL Performance Schema, create a least-privilege monitoring user, and configure Alloy to forward metrics and logs to Prometheus and Loki for visualization in Grafana Cloud dashboards.

Can I monitor query performance on cloud databases like RDS, Aurora, or Cloud SQL?

Yes, this Skill correlates db.statement and OpenTelemetry attributes with application traces. This allows you to trace slow queries back to specific services and requests, linking database behavior with application performance.

What do I need to configure before monitoring MySQL and PostgreSQL query metrics?

This Skill provides auto-provisioned query performance dashboards showing top queries by total time, call count, and mean latency. It also generates Prometheus alert rules for slow queries, high error rates, and connection saturation.

How do I correlate database slow queries with application traces?

Yes, this Skill works with self-managed and cloud variants including RDS, Aurora, Cloud SQL, and Azure. It captures query samples and visual explain plans across these platforms to pinpoint index usage and scan types.