Skip to main content
Connect MySQL by creating a monitoring user, confirming that performance_schema captures statement digests, and running the QueryComment collector.

Prepare MySQL

1

Create the monitoring user

Connect as a MySQL user with grant privileges and run:
PROCESS lets the collector inspect thread state and InnoDB status. REPLICATION CLIENT lets it read replication status when replicas are present.
Replace '%' with the collector host or subnet when you want to restrict where the monitoring user can connect from.
2

Enable statement digests

QueryComment uses performance_schema.events_statements_summary_by_digest for normalized query statistics.Confirm that performance_schema is enabled:
Confirm that statement digests are being collected:
If the consumer is disabled, enable it as an administrator:
3

Verify access

Confirm the monitoring user has the required grants and that digest rows exist:
If the digest table is empty, run a representative workload against the database and check again.

Collector connection values

Use the QueryComment collector with the bundled MySQL receiver. The collector is available as the ghcr.io/querycomment/collector:0.1.2 Docker image or as a release package for your operating system. Set these environment variables before starting the collector: Example .env file:
Run the collector with Docker:
Or choose the release package for your operating system and architecture. This example uses Linux amd64: