tracing: enhance payloads API to allow for ephemeral payloads #60997
Labels
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-observability
Is your feature request related to a problem? Please describe.
Payloads, once emitted, are immutable. That means that payloads are generally emitted after something interesting happened. That "something interesting" may block for a long time; maybe forever! So it should ideally be observable as well.
At the time of writing, the best we've got is finding the open trace span, getting the goroutine ID, and looking at goroutine dumps (where hopefully the goroutine that created the span is also the one still blocking on the "something interesting").
This could be a lot more useful if there were a way to attach "ephemeral" payloads to the trace that convert to a full payload once finalized.
Describe the solution you'd like
From today:
to some variation on:
Describe alternatives you've considered
There are probably better APIs than the above.
Additional context
This would definitely come in handy for contention events:
cockroach/pkg/kv/kvserver/concurrency/lock_table_waiter.go
Lines 751 to 755 in 64aadfe
But there has also been interest in making long-running backups more observable, for which this mechanism might be useful. For example, various backup spans could hang a progress report or latest error payload off the trace. The details here are unclear.
Jira issue: CRDB-3091
Epic CRDB-20779
The text was updated successfully, but these errors were encountered: