Skip to content

sql: add builtin to toggle span verbosity #61180

@angelapwen

Description

@angelapwen

Is your feature request related to a problem? Please describe.
@irfansharif suggested adding a mechanism in the SQL layer to tog span verbosity on and off ✨ This would allow us to selectively change span verbosity (along with the verbosity of any descendants of that span) directly from the shell.

For example, with this functionality we could query the crdb_internal.node_inflight_trace_spans virtual table for any pesky long-running spans, and toggle verbosity on to view log events and child spans of a particular long-running span.

Describe the solution you'd like
A builtin function called something like set_span_verbosity that would take a span ID and a bool (true to set to verbose and false to turn verbosity off). The function would basically be a wrapper around Span.SetVerbose(). The builtin could return a bool representing success (or failure, if no span exists for that span ID).

Describe alternatives you've considered
We considered toggling verbosity for all spans in a particular trace but opted for the granularity of a particular span because it is likely that we'd prefer to toggle verbosity for individual spans. If we wanted to toggle verbosity for all spans in a trace, we could do so by getting the root span ID for that trace from crdb_internal.node_inflight_trace_spans and feeding that into the builtin.

Metadata

Metadata

Assignees

Labels

A-kv-observabilityA-sql-observabilityRelated to observability of the SQL layerA-tracingRelating to tracing in CockroachDB.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions