Package brave.propagation
Class Propagation.Factory
java.lang.Object
brave.propagation.Propagation.Factory
- Direct Known Subclasses:
ExtraFieldPropagation.Factory
- Enclosing interface:
- Propagation<K>
public abstract static class Propagation.Factory extends Object
- Since:
- 4.0
-
Constructor Summary
Constructors Constructor Description Factory()
-
Method Summary
Modifier and Type Method Description abstract <K> Propagation<K>
create(Propagation.KeyFactory<K> keyFactory)
Deprecated.Since 5.12, useget()
TraceContext
decorate(TraceContext context)
Decorates the input such that it can propagate extra state, such as a timestamp or baggage.Propagation<String>
get()
Returns a possibly cached propagation instance.boolean
requires128BitTraceId()
Returnstrue
if the implementation cannot use 64-bit trace IDs.boolean
supportsJoin()
Does the propagation implementation support sharing client and server span IDs.
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
supportsJoin
public boolean supportsJoin()Does the propagation implementation support sharing client and server span IDs. For example, should an RPC server span share the same identifiers extracted from an incoming request? In usual B3 Propagation, the parent span ID is sent across the wire so that the client and server can share the same identifiers. Other propagation formats, like trace-context only propagate the calling trace and span ID, with an assumption that the receiver always starts a new child span. When join is supported, you can assume that whenthe parent span ID
is null, you've been propagated a root span. When join is not supported, you must always fork a new child.- Since:
- 4.7
-
requires128BitTraceId
public boolean requires128BitTraceId()Returnstrue
if the implementation cannot use 64-bit trace IDs.- Since:
- 4.9
-
create
Deprecated.Since 5.12, useget()
This is deprecated: end users and instrumentation should never call this, and instead useget()
.Implementation advice
This is deprecated, but abstract. This means those implementing custom propagation formats will have to implement this until it is removed in Brave 6. If you are able to use a tool such as "maven-shade-plugin", consider usingStringPropagationAdapter
.- Type Parameters:
K
- Deprecated except when aString
.- Since:
- 4.0
- See Also:
Propagation.KeyFactory.STRING
-
get
Returns a possibly cached propagation instance.Implementations should override and implement this method directly.
- Since:
- 5.12
-
decorate
Decorates the input such that it can propagate extra state, such as a timestamp or baggage.Implementations are responsible for data scoping, if relevant. For example, if only global configuration is present, it could suffice to simply ensure that data is present. If data is span-scoped, an implementation might compare the context to its last span ID, copying on write or otherwise to ensure writes to one context don't affect another.
Implementations should be idempotent, returning the same instance instead of re-applying change.
- Since:
- 4.9
- See Also:
TraceContext.extra()
-