K
- Usually, but not always a StringB3Propagation
, ExtraFieldPropagation
public interface Propagation<K>
trace identifiers
as text into carriers that travel
in-band across process boundaries. Identifiers are often encoded as messaging or RPC request
headers.
When using http, the carrier of propagated data on both the client (injector) and server (extractor) side is usually an http request. Propagation is usually implemented via library- specific request interceptors, where the client-side injects span identifiers and the server-side extracts them.
Modifier and Type | Interface | Description |
---|---|---|
static class |
Propagation.Factory |
|
static interface |
Propagation.Getter<C,K> |
Gets the first value of the given propagation key or returns null
|
static interface |
Propagation.KeyFactory<K> |
Creates keys for use in propagated contexts
|
static interface |
Propagation.Setter<C,K> |
Replaces a propagated key with the given value
|
Modifier and Type | Field | Description |
---|---|---|
static Propagation<String> |
B3_STRING |
Modifier and Type | Method | Description |
---|---|---|
<C> TraceContext.Extractor<C> |
extractor(Propagation.Getter<C,K> getter) |
|
<C> TraceContext.Injector<C> |
injector(Propagation.Setter<C,K> setter) |
Replaces a propagated field with the given value.
|
List<K> |
keys() |
The propagation fields defined.
|
static final Propagation<String> B3_STRING
List<K> keys()
Propagation.Setter.put(Object, Object, String)
.
For example, if the carrier is a single-use or immutable request object, you don't need to clear fields as they couldn't have been set before. If it is a mutable, retryable object, successive calls should clear these fields first.
<C> TraceContext.Injector<C> injector(Propagation.Setter<C,K> setter)
HttpURLConnection
would be the method reference
URLConnection.addRequestProperty(String, String)
setter
- invoked for each propagation key to add.<C> TraceContext.Extractor<C> extractor(Propagation.Getter<C,K> getter)
getter
- invoked for each propagation key to get.Copyright © 2018 OpenZipkin. All rights reserved.