Skip to content

Rate this page
Thanks for your feedback
Thank you! The feedback has been submitted.

Get free database assistance or contact our experts for personalized support.

QAN Stored metrics

Stored metrics captures queries after they complete, so you can review historical performance, find slow queries, and track optimization progress over time.

Supported databases

Stored metrics supports MySQL, MongoDB, and PostgreSQL with the following requirements:

  • MySQL 5.1 or later (if using the slow query log)
  • MySQL 5.6.9 or later (if using Performance Schema)
  • Percona Server 5.6+ (all Performance Schema and slow log features)
  • MariaDB 5.2+ (for user statistics), 10.0+ (for Performance Schema)

Some limitations and tuning options apply when using MySQL’s Performance Schema. See Query Analytics with MySQL.

  • PostgreSQL 11 or later
  • pg_stat_monitor extension (recommended) or pg_stat_statements extension
  • Appropriate shared_preload_libraries configuration
  • Superuser privileges for PMM monitoring account
  • MongoDB 6.0 or later (4.4+ may work with limited features)

Profiler requirements

  • Profiling enabled for Query Analytics
  • Appropriate user roles: clusterMonitor, read (local), and custom monitoring roles
  • For MongoDB 8.0+: Additional directShardOperations role required for sharded clusters

Mongolog requirements

  • MongoDB configured to log slow operations to a file
  • MongoDB server has write permissions to the log directory and file
  • PMM agent has read permissions to the MongoDB log file
  • Appropriate user roles: clusterMonitor, or custom monitoring roles (getCmdLineOpts privilege on { cluster: true })

Dashboard layout

The Stored metrics view contains three panels:

Data collection

Stored metrics collects data once per minute. When collection delays occur, gaps may appear in the sparkline.

Monitor PMM Server’s internal PostgreSQL

By default, Query Analytics hides queries from PMM Server’s internal PostgreSQL database. This keeps the focus on your monitored databases.

Enable this when you need to troubleshoot PMM Server performance, check resource usage, or ensure applications are not accidentally using the default postgres database. This is particularly useful in High Availability (HA) deployments.

To enable:

  1. Go to PMM Configuration > Settings > Advanced Settings.
  2. Switch on the QAN for PMM Server option.
  3. Open Query Analytics and filter by pmm-server-postgresql to view queries.

When enabled, you’ll see queries related to PMM’s internal operations—inventory, settings, advisor checks, alerts, backups, and authentication. These are usually lightweight, but unusual spikes may indicate performance issues.

Warning

Do not use PMM Server’s PostgreSQL database for application workloads. Use dedicated databases for your applications.

See also