News

Grafana links application traces to database queries: trace linkage now GA

Grafana Cloud makes trace linkage generally available: trace application requests directly to slow database queries.

UptimeMag editorial team · 3 November 2026 · 2 min read

Grafana collega trace applicative e query database: trace linkage in GA

As of 3 November 2026, Grafana Cloud Database Observability trace linkage is now generally available. The feature helps teams understand why an application request is slow: instead of opening the trace, reading the query name, and then manually hunting through database logs, you click on the span and land directly on the query page in Database Observability, complete with samples, performance history and explain plans.

How the linking works

The system compares the query text in the span against queries that Database Observability has already collected. This text-based matching works out of the box without additional configuration, provided your OpenTelemetry instrumentation populates the db.query.text attribute or the legacy db.statement attribute.

For precise matching tied to a single execution, you need sqlcommenter. Sqlcommenter is an open source project donated to the OpenTelemetry community that injects trace IDs and span IDs into a comment appended to the SQL statement, creating a link between a specific span and the exact query execution. Exact matching only covers executions actually sampled by Database Observability: it improves the precision of discovered links, not the frequency with which a link resolves. Teams unable or unwilling to use sqlcommenter (not all database engines support it, and it carries a database cache cost) remain covered by text-based matching, which is less precise but still useful.

The official release notes show incremental improvements after the initial release: in build v2.35.0 on 21 September 2026, MySQL named parameter recognition was fixed in the .NET driver, a bug with trailing semicolons in MySQL queries was resolved, matching for Npgsql queries on PostgreSQL was added, and a fallback was introduced to ignore the database name when it changes due to connection pooling.

Database Observability pricing

The module is billed per host-hour of monitored database, separate from generated telemetry. On Grafana's official product page, the tiers are:

Plan Included threshold Cost beyond threshold
Free 3 database hosts (2,232 host-hours/month) —
Pro 2,232 host-hours included in $19/month subscription $0.07/host-hour (approximately $51/host/month)
Enterprise Custom Minimum commitment $25,000/year

Teams already running Database Observability on MySQL 8+ or PostgreSQL 14+ with active OpenTelemetry instrumentation can try trace linkage without changes, starting with text-based matching and adding sqlcommenter later if you need precision on exact executions.

Written with the help of artificial intelligence and checked by the editors (EU AI Act, art. 50).