You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working with pg_tracing in PostgreSQL and can successfully set the trace context using:
SET LOCAL pg_tracing.trace_context = 'traceparent=''00-00000000000000000000000000000005-0000000000000005-01''';.
However, I am struggling to understand how to retrieve the current active trace context for logging or restoration purposes. Is there a way to query or fetch the active trace_context once it's been set, or a recommended approach to restore the trace context in subsequent operations?
The text was updated successfully, but these errors were encountered:
I am struggling to understand how to retrieve the current active trace context for logging or restoration purposes
That would require to be able to log an arbitrary GUC value which is not something that's supported by PG.
Is there a way to query or fetch the active trace_context once it's been set
You can use SHOW pg_tracing.trace_context to display the value set in the current session.
a recommended approach to restore the trace context in subsequent operations?
I'm not 100% sure what you mean by that. I'm mostly relying on SQLCommenter to propagate tracecontext while setting it through the GUC value is here as a possible fallback. Does it mean you have some kind of nested span, which will query PG and you want to go back to the previous trace context to go back to the parent span?
I've been working with pg_tracing in PostgreSQL and can successfully set the trace context using:
SET LOCAL pg_tracing.trace_context = 'traceparent=''00-00000000000000000000000000000005-0000000000000005-01''';.
However, I am struggling to understand how to retrieve the current active trace context for logging or restoration purposes. Is there a way to query or fetch the active trace_context once it's been set, or a recommended approach to restore the trace context in subsequent operations?
The text was updated successfully, but these errors were encountered: