Package org.microproxy.otel
Interface Propagator
public interface Propagator
Reads a trace context from request headers and writes one onto them, in one format: W3C Trace
Context (
Propagators.TRACE_CONTEXT), B3 in its single-header and multi-header forms
(Propagators.B3, Propagators.B3_MULTI) or Jaeger's uber-trace-id (Propagators.JAEGER). The configured propagators form OpenTelemetry's composite propagator:
they extract in order, each over what the previous ones found, so the last that finds a valid
context gives the parent; and every one of them injects the proxy's context.-
Method Summary
Modifier and TypeMethodDescriptionextract(HttpHeaders headers) Reads the trace context inheaders.fields()Returns the headers this propagator reads and writes, lower-case.voidinject(SpanContext context, HttpHeaders headers) name()Returns the nameOTEL_PROPAGATORSgives this propagator, such astracecontext.
-
Method Details
-
name
String name()Returns the nameOTEL_PROPAGATORSgives this propagator, such astracecontext.- Returns:
- the name
OTEL_PROPAGATORSgives this propagator, such astracecontext
-
fields
Returns the headers this propagator reads and writes, lower-case.- Returns:
- the headers this propagator reads and writes, lower-case
-
extract
Reads the trace context inheaders.- Parameters:
headers- the request's headers- Returns:
- the remote context, or
nullwhen there is none or it is not valid
-
inject
- Parameters:
context- the context to send onheaders- the request's headers, changed in place
-