Skip to main content
Use the QueryComment collector with the bundled SQL Server receiver after you grant collector access. The collector is available as the ghcr.io/querycomment/collector:0.1.2 Docker image or as a release package for your operating system.

Environment variables

Set the following environment variables before starting the collector:
URL-encode special characters in the username or password in SQLSERVER_DATASOURCE. Use port 1433 unless your instance uses a different port.

Run the collector

Run the collector with Docker:
Or choose the release package for your operating system and architecture. This example uses Linux amd64:
The collector checks for recently completed statements every 60s. It emits up to 250 statement fingerprints from a candidate set of up to 1000. Set QC_QUERY_METRICS_ENABLED=false only when you need to disable statement metrics temporarily.
For self-hosted SQL Server, include host_metrics only when the collector runs on the database host. For Azure SQL Database, remove the host_metrics receiver and remove host_metrics from service.pipelines.metrics.receivers.