For MySQL, PostgreSQL and MongoDB with query analytics out of the box, Percona PMM is the most complete single package. If you already run Prometheus, add postgres_exporter, mysqld_exporter or sql_exporter (SQL Server) and draw dashboards in Grafana. If Zabbix already watches your servers, its official database templates are the least extra work. For PostgreSQL alone, pgwatch gives continuous metrics and pgBadger turns logs into reports. None of these is free to operate: you supply the servers, storage, upgrades and alert tuning.
"Open source" here means the code you run is under an OSI-style open source licence (Apache 2.0, MIT, BSD, GPL, AGPL or the PostgreSQL Licence). We excluded tools whose core is source-available or whose interface is closed. Licence still matters in practice: AGPLv3 (Grafana, Zabbix, PMM Server) requires you to publish changes if you modify the software and offer it to others over a network, which rarely affects internal monitoring but matters if you build a product on it.
Every tool on this page reads the database's own statistics. For PostgreSQL, that is mostly pg_stat_statements (loaded through shared_preload_libraries and created with CREATE EXTENSION) and the pg_stat_* views; for MySQL, Performance Schema and the sys schema; for SQL Server, DMVs and Query Store. The query below (PostgreSQL 14 and later) is the core of what query-level tools show:
-- PostgreSQL: top statements by total execution time
SELECT query,
calls,
total_exec_time,
mean_exec_time,
rows
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;For commercial and SaaS options alongside these, see the best database monitoring tools.
Quick picks
Dashboards, Query Analytics, advisors and alerting for MySQL, PostgreSQL and MongoDB in one server image.
Apache 2.0 and MIT exporters for PostgreSQL, MySQL and SQL Server feed the metrics stack you already operate.
Official SQL Server templates through Zabbix agent 2 or ODBC, covering counters, jobs, backups and availability groups.
A single Perl script that turns PostgreSQL logs into HTML reports, with nothing to keep running.
How we chose
We considered Prometheus with the community exporters, Grafana, Percona Monitoring and Management, Zabbix, pgwatch, pgBadger and Netdata. To be listed, the project had to be actively released in 2026, publish a clear open source licence in its repository or on its site, and be usable to monitor at least one of SQL Server, PostgreSQL, MySQL or MongoDB.
Netdata is not an entry: its Agent is GPLv3+, but Netdata states that its dashboard UI is closed source (free to use). pgAdmin's dashboards are covered in pgAdmin vs pgBadger. Commercial tools with open source collectors, such as pganalyze, are in the hub guide.
For each project we recorded the licence, the components you must run, where data is stored, what it collects and its main trade-off. The order is not a ranking.
At a glance
| Tool | Type | Engines | Deployment | Pricing model | Main trade-off |
|---|---|---|---|---|---|
| Prometheus and exporters | Metrics collection and storage (Apache 2.0; sql_exporter MIT) | PostgreSQL, MySQL, MariaDB, SQL Server and others | Prometheus server plus one exporter per database type; local TSDB | Free | Metrics only; 15-day default retention, not clustered |
| Grafana | Dashboards and alerting (AGPLv3) | Any data source it can query | Grafana server plus SQLite, MySQL or PostgreSQL for its settings | Free; paid Enterprise and Cloud | Visualisation only; needs a data source |
| Percona PMM | All-in-one monitor (Server AGPLv3, Client Apache 2.0) | MySQL, MariaDB, PostgreSQL, MongoDB, Valkey, Redis | PMM Server container or appliance (VictoriaMetrics, ClickHouse, PostgreSQL) plus PMM Client per host | Free; paid Percona support | No SQL Server or Oracle |
| Zabbix | Monitoring platform (AGPLv3 from 7.0) | SQL Server, MySQL, PostgreSQL and others via templates | Zabbix server, PHP frontend, backend database, agents | Free; paid support | Shallow query-level analysis |
| pgwatch | PostgreSQL monitor (BSD-3-Clause) | PostgreSQL only | Collector with web UI, PostgreSQL or TimescaleDB store, Grafana | Free | PostgreSQL only |
| pgBadger | Log analyser (PostgreSQL Licence) | PostgreSQL only | Perl script run on log files | Free | After-the-fact reports, not live monitoring |
Prometheus and database exporters
Prometheus (3.15.0 when checked) is a time-series database and alerting system, Apache 2.0 licensed, that pulls metrics from HTTP endpoints called exporters. For databases the common choices are postgres_exporter (prometheus-community, Apache 2.0, CI-tested on PostgreSQL 13 to 18), mysqld_exporter (Prometheus project, Apache 2.0, MySQL 5.6 and later and MariaDB 10.3 and later) and, for SQL Server, where the Prometheus project has no exporter of its own, the MIT-licensed sql_exporter maintained by burningalchemist, which runs your own SQL queries against SQL Server, PostgreSQL, MySQL, Oracle and others and is embedded in Grafana Alloy as prometheus.exporter.mssql.
What it takes to run: a Prometheus server with disk for its local TSDB, one exporter process per database (or one multi-target exporter), a monitoring login on each database, Alertmanager for notifications and usually Grafana for dashboards. Prometheus keeps 15 days of data by default, and its documentation says local storage is not clustered or replicated, so long retention or high availability needs remote-write storage. See Prometheus vs Datadog.
- Metrics only: no per-execution query samples or execution plans.
- You build or import dashboards and alert rules and keep them working through upgrades.
- High-cardinality labels (for example per-query metrics) can grow storage quickly (editorial).
Grafana
Grafana is the dashboard layer in most open source monitoring stacks, licensed AGPL-3.0-only (with some Apache 2.0 parts listed in its LICENSING file). It queries Prometheus and other time-series stores, and can also query PostgreSQL, MySQL and SQL Server directly with SQL, which lets you chart a table of snapshots you collect yourself. It includes alerting.
What it takes to run: the Grafana server, plus a database for its own settings and dashboards. It uses embedded SQLite by default, and Grafana's documentation recommends MySQL or PostgreSQL instead for production. Grafana collects nothing by itself.
- Visualisation and alerting only; it needs a data source that holds the metrics.
- AGPLv3 obligations apply if you modify it and offer it to others over a network.
- Community dashboards vary in quality and may not match your exporter version (editorial).
Percona Monitoring and Management
PMM packages what you would otherwise assemble yourself. Percona's repository lists PMM Server under AGPLv3 and PMM Client under Apache 2.0; version 3 is current, and the latest release when checked was 3.9.1 (19 August 2026), a security-focused release. It monitors MySQL (including Percona Server, MariaDB and Amazon RDS and Aurora MySQL), PostgreSQL, MongoDB, ProxySQL, Valkey and Redis, with Query Analytics, Percona Advisors for configuration and security checks, alerting with many notification channels, and backup management for MySQL and MongoDB.
What it takes to run: PMM Server as a container, Kubernetes deployment or virtual appliance, which bundles Grafana, VictoriaMetrics for metrics, ClickHouse for query analytics and PostgreSQL for its own data, plus PMM Client on or near each monitored host. Plan disk for metrics and query data, and keep the server patched.
- No SQL Server or Oracle support.
- One more stateful server (with three embedded data stores) to back up, secure and upgrade.
- Support is a separate Percona contract.
Zabbix
Zabbix is licensed AGPLv3 from version 7.0 (versions up to 6.4 were GPLv2); 7.4 is the current release and 8.0 is in development. Official templates cover SQL Server through Zabbix agent 2 or ODBC (tested on SQL Server 2017, 2019 and 2022), collecting buffer cache, page life expectancy, locks and deadlocks, transactions, database state and size, backups, SQL Agent jobs and availability groups, with similar templates for MySQL, PostgreSQL and other engines.
What it takes to run: the Zabbix server, a PHP web frontend behind Apache or Nginx, a backend database (MySQL 8.0.30 or later, MariaDB 10.5 or later, PostgreSQL 13 to 18, optionally TimescaleDB), and agents or proxies near the monitored systems.
- Threshold and counter monitoring rather than query plans or per-query history (editorial).
- Several components to run and size, including its own database.
- Templates usually need tuning to avoid alert noise (editorial).
pgwatch
pgwatch, developed by CYBERTEC, is a PostgreSQL-only monitoring tool under the BSD-3-Clause licence, now at major version 5. It collects metrics defined as SQL queries against the pg_stat_* views and extensions, and ships pre-built Grafana dashboards.
What it takes to run: the pgwatch collector with its web UI, a PostgreSQL or TimescaleDB database for configuration and metrics (Prometheus and JSON outputs are also supported), and Grafana. Docker Compose files and a demo image are provided.
- PostgreSQL only.
- You maintain the metrics database and Grafana alongside it.
pgBadger
pgBadger is a PostgreSQL log analyser, distributed under the PostgreSQL Licence; the current release is 13.2. It reads PostgreSQL log files and produces an HTML report with the slowest and most frequent queries, connections and sessions, errors, locks, temporary files, checkpoints and autovacuum activity.
What it takes to run: only a modern Perl distribution, plus PostgreSQL logging configured for it: log_min_duration_statement (0 logs every statement) and a log_line_prefix that includes time and process ID. Logging every statement on a busy server produces large logs, so many teams use a threshold instead. See pgAdmin vs pgBadger.
- Reports on past logs; no live view or alerting.
- Results depend on logging settings, which add log volume.
- PostgreSQL only.
How to choose, and what it costs to run
Choose by engine and by what you already operate. MySQL, PostgreSQL or MongoDB and nothing else in place: PMM. A Prometheus and Grafana platform already running: add exporters. Zabbix already watching servers: use its database templates, especially for SQL Server, where open source query-level options are thin. PostgreSQL only: pgwatch for continuous metrics and pgBadger for log reports, which work well together.
Budget for the work as well as the hardware: a server or cluster for collection and storage, disk sized for your retention, backups of the monitoring data, a least-privilege monitoring login on every database, upgrades for each component, and time to tune dashboards and alerts. If that adds up to more than a licence, a commercial or cloud-native tool from the hub guide may cost less overall.
Frequently asked questions
Is Grafana open source?
Yes. Grafana is licensed AGPL-3.0-only, with some components under Apache 2.0 as listed in its repository. Grafana Labs also sells Grafana Enterprise and Grafana Cloud.
Is Percona PMM free?
Yes. PMM Server is AGPLv3 and PMM Client is Apache 2.0, with no licence fee. Percona sells support separately.
Is there an open source SQL Server monitoring tool?
Zabbix has official SQL Server templates, and Prometheus can collect SQL Server metrics through the MIT-licensed sql_exporter. For diagnosis, the First Responder Kit (MIT) and sp_WhoIsActive (GPLv3) are free scripts. See SQL Server monitoring tools.
Can Prometheus show slow queries?
Only as aggregated metrics, if an exporter exposes them (for example from pg_stat_statements). Prometheus does not store individual query executions or plans; for those use PMM Query Analytics, pgBadger, or a commercial tool.
Is Zabbix still GPL?
No. Zabbix moved to AGPLv3 from version 7.0. Versions up to 6.4 were released under GPLv2.
Is Netdata open source?
Partly. The Netdata Agent is GPLv3+, but Netdata states that its dashboard UI is closed source and free to use, which is why it is not listed here.
Sources
- Prometheus repository (Apache 2.0)
- Prometheus storage documentation
- postgres_exporter (prometheus-community)
- mysqld_exporter
- sql_exporter (MIT)
- Grafana Alloy prometheus.exporter.mssql
- Grafana repository (AGPL-3.0)
- Grafana configuration (database section)
- Percona PMM repository and licences
- Percona PMM releases
- Zabbix licence
- Zabbix requirements
- Zabbix SQL Server integration
- pgwatch repository
- pgBadger repository
- Netdata repository (licensing)
- pg_stat_statements (PostgreSQL documentation)
Checked October 2026.
How we research these guides: our editorial method.