CockroachDB Videos
← Back to all videos

CockroachDB Observability: Query Tags

2026-06-08

Demos & Tutorials Observability

Description

CockroachDB's query tags utilize the SQLcommenter specification to provide deep visibility into database performance by linking SQL statements directly to their originating applications. Developers can attach metadata (such as service names, endpoints, and drivers) as key-value pairs within comments, which CockroachDB then stores as JSON for querying. This enhanced detail allows for the rapid root cause identification of performance issues; moving beyond general query performance to precise application insights. Rob Reid shows how these tags pinpoint performance regressions during an endpoint migration, leading to the successful application of recommended indexes to restore performance. While many Object-Relational Mappers (ORMs) offer built-in support for these tags, they can also be easily constructed manually to improve database observability. Ultimately, query tags empower teams to manage complex services more effectively by providing a clear understanding of how different applications interact with the database. 00:00 Query tags overview 00:29 Cluster setup 00:37 Enable SQLcommenter and configure latency threshold 01:11 Analyzing query metadata for a slow query 02:08 Querying JSON internals 02:51 Identifying performance regressions 03:52 Reviewing application code 04:36 Applying recommended indexes 05:31 Conclusion Learn more at cockroachlabs.com #distributedsql #databases #cockroachdb Summarize this data