gorm-prometheus

Expose GORM database metrics to Prometheus for monitoring.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/liurida/gorm-development-skill --skill gorm-prometheus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gorm-prometheus
Source: https://github.com/liurida/gorm-development-skill/tree/main/prometheus
Command: npx skills add https://github.com/liurida/gorm-development-skill --skill gorm-prometheus

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers need clear, real‑time visibility into GORM database health, connection pool statistics, and custom query metrics, but manually gathering and exposing these data points is labor‑intensive and error‑prone.

Core Features & Use Cases

  • Automatic collection of sql.DBStats such as open connections, wait counts, and idle connections.
  • Support for custom metric collectors, including MySQL status variables.
  • Built‑in HTTP metrics endpoint or Pushgateway integration for flexible deployment.
  • Multi‑database labeling via DBName to distinguish metrics from different sources.
  • Simple plug‑and‑play configuration using the GORM Prometheus plugin.

Quick Start

Use the gorm-prometheus skill to configure Prometheus monitoring for your GORM database.

Frequently Asked Questions about gorm-prometheus

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

FAQPage Schema
How do I monitor GORM database connection pool metrics with Prometheus?

You monitor GORM database metrics by applying the Prometheus plugin to automatically collect connection pool statistics like open connections, wait counts, and idle connections for real-time observability.

Can I track custom query metrics like MySQL status variables in GORM?

Yes, you can track custom query metrics like MySQL status variables in GORM by configuring optional custom metric collectors within the Prometheus plugin to satisfy specific observability and alerting requirements.

How do I expose GORM metrics to Prometheus in a Go application?

You expose GORM metrics to Prometheus in a Go application by configuring the Prometheus plugin with parameters like DBName and refresh interval, then using the built-in HTTP metrics endpoint or Pushgateway integration for deployment.

Does the Prometheus plugin support monitoring multiple GORM databases?

Yes, the Prometheus plugin supports monitoring multiple GORM databases by applying multi-database labeling via the DBName configuration, which distinguishes metrics from different database sources.

What GORM Prometheus configuration is needed for real-time database health monitoring?

Real-time database health monitoring requires configuring the Prometheus plugin with DBName for source labeling, a refresh interval for data collection frequency, and optional custom collectors to capture specific metrics.