Skip to content

DOC-13899 Product Change- PR #147439 - ui: surface SQL commenter query tags in insights #19897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

florence-crl
Copy link
Contributor

@florence-crl florence-crl commented Jul 7, 2025

Fixes DOC-13899 DOC-13614

In include file insights.md, (1) added section for Query tags and (2) corrected SQL CPU Time column name.

Rendered preview

Copy link

github-actions bot commented Jul 7, 2025

Files changed:

Copy link

netlify bot commented Jul 7, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit f9a6f79
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/686f256035358d0008fbbbdb

Copy link

netlify bot commented Jul 7, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit f9a6f79
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/686f255f71dc220008aafa01

Copy link

netlify bot commented Jul 7, 2025

Netlify Preview

Name Link
🔨 Latest commit f9a6f79
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/686f255fc089bc000898fad1
😎 Deploy Preview https://deploy-preview-19897--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@florence-crl florence-crl requested review from mikeCRL, angles-n-daemons, kyle-a-wong and kevin-v-ngo and removed request for mikeCRL July 7, 2025 19:51
Copy link

@angles-n-daemons angles-n-daemons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for adding this!

@florence-crl florence-crl requested a review from mikeCRL July 10, 2025 17:21
Copy link

@kevin-v-ngo kevin-v-ngo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits regarding how SQL comments (that following the SQLcommenter specification) is an opt-in experience that can be used for application correlation.

@@ -122,15 +122,50 @@ Start Time (UTC) | The timestamp when the statement execution started.
Elapsed Time | The time that elapsed to complete the statement execution.
User Name | The name of the user that invoked the statement execution.
Application Name | The name specified by the [`application_name`]({{ link_prefix }}show-vars.html#supported-variables) session setting.
Query Tags | The [query tags](#query-tags) extracted from comments in the statement query. These tags provide application context and can be used to correlate query performance with client-side application state.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can* help provide application if set

Note: Users don't get this out of the box. They need to instrument the comment in their query.

{%- endif %}
Full Scan | Whether the execution performed a full scan of the table.
Transaction Fingerprint ID | The ID of the transaction fingerprint for the statement execution.
Latest Transaction Execution ID | The ID of the transaction execution for the statement execution.

#### Query tags

{% include_cached new-in.html version="25.3.0" %} The **Query Tags** column displays SQLcommenter query tags for statement executions. These tags provide application context, such as the application name, user ID, or feature flags, embedded in SQL comments that follow the [SQLcommenter specification](https://google.github.io/sqlcommenter/spec/). This information helps correlate slow query performance with specific application states. The **Query Tags** column is available in the **Statement Executions** view's **Statement Insights** table but is hidden by default. To display it, use the **Columns** selector.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

displays SQLcommenter query tags for statement executions

Can we say displays the comments embedded int he query as defined by the specification?

These tags provide application context, such as the application name, user ID, or feature flags, embedded in SQL comments that follow the

Users need to instrument this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants