Package codes.grow.packages.skywalking
Class Sw8Propagator
java.lang.Object
codes.grow.packages.skywalking.Sw8Propagator
- All Implemented Interfaces:
io.opentelemetry.context.propagation.TextMapPropagator
public final class Sw8Propagator
extends Object
implements io.opentelemetry.context.propagation.TextMapPropagator
OpenTelemetry propagator for SkyWalking headers (propagator name
sw8).
- extract (default use): a valid
sw8header is stored in the context (Sw8.fromContext(io.opentelemetry.context.Context),Sw8.attributes(codes.grow.packages.skywalking.Sw8Context)); its trace id is not hex, so the W3C context stays the OpenTelemetry trace.sw8-correlationentries are added to the baggage. - inject: only when native metadata was set with
Sw8.withContext(io.opentelemetry.context.Context, codes.grow.packages.skywalking.Sw8Context); otherwise nothing is written (an OpenTelemetry span has no segment id or native span id).
For full native cross-process traces use the official SkyWalking Java agent.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<C> io.opentelemetry.context.Contextextract(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapGetter<C> getter) fields()static Sw8PropagatorThe shared instance.<C> voidinject(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapSetter<C> setter) toString()
-
Constructor Details
-
Sw8Propagator
public Sw8Propagator()
-
-
Method Details
-
getInstance
The shared instance.- Returns:
- the propagator
-
fields
- Specified by:
fieldsin interfaceio.opentelemetry.context.propagation.TextMapPropagator
-
inject
public <C> void inject(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapSetter<C> setter) - Specified by:
injectin interfaceio.opentelemetry.context.propagation.TextMapPropagator
-
extract
public <C> io.opentelemetry.context.Context extract(io.opentelemetry.context.Context context, C carrier, io.opentelemetry.context.propagation.TextMapGetter<C> getter) - Specified by:
extractin interfaceio.opentelemetry.context.propagation.TextMapPropagator
-
toString
-