Class TraceContexts
TraceContextCarrier.
juneau-rest-server has no first-party call site for this helper — it exists so a
future MCP-client (or any other non-HTTP caller) adapter can inject the active trace context into
whatever carrier it builds (for example a RequestMeta being sent as a JSON-RPC request's
params._meta) without that adapter depending on OpenTelemetry. The adapter depends only on
this class and the installed TracerHook.
Off-by-default contract
inject(TracerHook, TraceContextCarrier) does nothing but null-check its arguments and
delegate to TracerHook.inject(TraceContextCarrier). Against NoOpTracerHook (or any
bridge that does not override inject), the default no-op implementation writes nothing to
the carrier — only a bridge with an actual trace context to render (for example the
OpenTelemetry bridge in juneau-rest-server-tracing-otel) writes traceparent /
tracestate / baggage keys.
See Also:
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidinject(TracerHook tracer, TraceContextCarrier carrier) Injects the caller's current trace context (as understood bytracer ) intocarrier .
-
Method Details
-
inject
Injects the caller's current trace context (as understood bytracer ) intocarrier .- Parameters:
tracer- TheTracerHookwhose active trace context (if any) should be rendered. Must not benull .carrier- TheTraceContextCarrierto write into. Must not benull .
-