At a glance
| Database engines | Any engine with an exporter: MySQL, MariaDB, PostgreSQL, SQL Server, Oracle, MongoDB, Redis and more |
| Deployment | Self-hosted binaries, Docker or Kubernetes |
| Collection/agents | One exporter per database or a multi-target exporter, scraped over HTTP |
| Alerting | Alert rules in Prometheus; notifications through Alertmanager |
| Query monitoring | Aggregated metrics only, where an exporter exposes them |
| Metrics retention | 15 days by default; local storage is not clustered or replicated |
| Licensing | Apache 2.0 |
Prometheus is the natural choice for database metrics if you already run it for infrastructure: add an exporter per database type and reuse your alerting and Grafana dashboards. It collects metrics only, not query samples or execution plans, and its local storage is not clustered, so long retention or high availability needs extra components.
Overview
Prometheus is an open source monitoring system and time-series database, a Cloud Native Computing Foundation project licensed under Apache 2.0. It pulls metrics over HTTP from targets called exporters, stores them in a local time-series database, evaluates alert rules, and lets you query data with PromQL. Version 3.16.0 was released on 4 November 2026.
For databases, Prometheus relies on exporters. The project's exporter list marks only the MySQL server exporter (mysqld_exporter) as official among database exporters; others, such as the PostgreSQL exporter maintained by prometheus-community, the MSSQL server exporter, the Oracle DB exporter, the MongoDB exporter, the Redis exporter and the generic SQL exporter, are third-party. Notifications go through Alertmanager, and Grafana is the usual dashboard layer.
Key features
- Pull-based collection from exporters, with service discovery for dynamic targets
- PromQL query language for graphs, recording rules and alert rules
- Alert rules evaluated by Prometheus and routed through Alertmanager
- Official mysqld_exporter plus third-party exporters for PostgreSQL, SQL Server, Oracle, MongoDB, Redis, ClickHouse and others
- Local time-series database with 15 days of retention by default, configurable by time or size
- Remote write and remote read for long-term or replicated storage elsewhere
Pros and cons
Pros
- Free and open source under Apache 2.0
- One metrics and alerting system for databases and the rest of the infrastructure
- Large exporter ecosystem covering most database engines
- PromQL and Alertmanager give flexible alerting
Cons
- Metrics only: no per-execution query samples or execution plans
- Local storage is not clustered or replicated; long retention or high availability needs remote storage
- Most database exporters are third-party, so quality and maintenance vary by project
- You build or import dashboards and alert rules and keep them working
Pricing
Prometheus is free and open source under the Apache 2.0 licence, and so are the official mysqld_exporter and the community postgres_exporter. There is no paid edition; your costs are the servers, storage and staff time to run it. Hosted Prometheus-compatible services from other vendors are priced separately.
Pricing checked on the vendor's official page on 7 November 2026. Prices change; confirm before buying.
Who it is best for
Teams that already run Prometheus for infrastructure and want database metrics and alerts in the same system.
Who should look elsewhere
- Teams that need query-level analysis and plans: see Percona PMM or database monitoring tools.
- Teams that would rather not operate monitoring infrastructure: see Prometheus vs Datadog.
Verdict
Prometheus is a dependable free foundation for database metrics and alerting, especially where it already monitors the rest of the stack. It is not a query analysis tool, and most database exporters are community projects, so pair it with a query-level tool when you need to diagnose individual statements.
Frequently asked questions
Can Prometheus monitor SQL Server?
Yes, through a third-party exporter such as the MSSQL server exporter or the generic SQL exporter, both listed on the Prometheus exporters page. The Prometheus project does not maintain an official SQL Server exporter.
How long does Prometheus keep data?
By default 15 days, unless you set storage.tsdb.retention.time or storage.tsdb.retention.size. Prometheus documents that local storage is not clustered or replicated.
Can Prometheus show slow queries?
Only as aggregated metrics if an exporter exposes them, for example from pg_stat_statements. It does not store individual query executions or plans.
Sources
- Prometheus repository (Apache 2.0)
- Prometheus releases
- Prometheus storage documentation
- Prometheus exporters and integrations
- Prometheus downloads
- mysqld_exporter
- postgres_exporter (prometheus-community)
Checked November 2026.
How we research reviews and what star ratings mean: our editorial method.