TraceContext
The ids of a span in the coroutine context. An OtlpObserver puts one in the context of each node, with the span of the node. Read it with currentCoroutineContext()[TraceContext], for example to log the trace id next to a message, or let the Traceparent plugin send it with each request.
The app can put one around a run too, and the OtlpObserver records the run inside that span. A server continues the trace of the request that started the run:
val trace = TraceContext.parse(call.request.headers["traceparent"])
withContext(trace ?: EmptyCoroutineContext) { graph.invoke(ticket, config) }Content copied to clipboard
A run started inside a node traced by an OtlpObserver, such as a graph that a tool runs, is in the span of that node without anything more.
Throws
Types
Link copied to clipboard
The key of TraceContext in a coroutine context.
Properties
Link copied to clipboard
Link copied to clipboard
The ids as the traceparent header of W3C Trace Context.