Class InboundTraceContext
- Namespace
- FlowOrchestrator.Core.Observability
- Assembly
- FlowOrchestrator.Core.dll
Helpers for extracting an ActivityContext from W3C trace-context headers on an inbound HTTP request.
public static class InboundTraceContext
- Inheritance
-
InboundTraceContext
- Inherited Members
Remarks
The Dashboard's webhook and signal endpoints call TryParse(string?, string?, out ActivityContext) with the values of the
inbound traceparent / tracestate headers and, on success, start the entry-point
activity as a child of the parent context. This stitches the run's spans onto the caller's
distributed trace even when the consuming app has not enabled
AddAspNetCoreInstrumentation(). The helper lives in Core so it is reusable from any
runtime adapter that exposes its own ingress points.
Fields
TraceparentHeaderName
The standard W3C header name for the incoming trace identifier.
public const string TraceparentHeaderName = "traceparent"
Field Value
TracestateHeaderName
The standard W3C header name for vendor-specific trace state.
public const string TracestateHeaderName = "tracestate"
Field Value
Methods
StartActivity(ActivitySource, string, ActivityKind, string?, string?)
Starts an inbound activity, using the W3C headers as the parent context when present. Falls back to a normal root activity when the headers are absent or invalid.
public static Activity? StartActivity(ActivitySource source, string name, ActivityKind kind, string? traceparent, string? tracestate)
Parameters
sourceActivitySourceThe activity source to start the activity on.
namestringActivity name (e.g.
"flow.webhook.receive","flow.signal.deliver").kindActivityKindActivity kind. Defaults to Server for HTTP ingress.
traceparentstringInbound
traceparentheader value or null.tracestatestringInbound
tracestateheader value or null.
Returns
TryParse(string?, string?, out ActivityContext)
Attempts to parse an ActivityContext from the standard W3C headers.
public static bool TryParse(string? traceparent, string? tracestate, out ActivityContext context)
Parameters
traceparentstringValue of the
traceparentheader, or null.tracestatestringValue of the
tracestateheader, or null.contextActivityContextReceives the parsed context on success.