Top Description Inners
io.micrometer.observation.transport

public Interface Propagator

Imports
io.micrometer.common.lang.Nullable

Inspired by OpenZipkin Brave and OpenTelemetry. Most of the documentation is taken directly from OpenTelemetry. Injects and extracts a value as text into carriers that travel in-band across process boundaries. Encoding is expected to conform to the HTTP Header Field semantics. Values are often encoded as RPC/HTTP request headers.
Authors
OpenZipkin Brave Authors, OpenTelemetry Authors, Marcin Grzejszczak
Since
1.10.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Propagator.Getter<
carrier of propagation fields, such as an http request.
C
>

Interface that allows to read propagated fields from a carrier.

public static interface
Propagator.Setter<
carrier of propagation fields, such as an http request
C
>

Class that allows to set propagated fields into a carrier.

io.micrometer.observation.transport back to summary

public Interface Propagator.Getter<C>

Type Parameters
<C>
carrier of propagation fields, such as an http request.

Interface that allows to read propagated fields from a carrier.

Getter is stateless and allows to be saved as a constant to avoid runtime allocations.

Since
1.10.0

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the first value of the given propagation key or returns null.
get
(C
carrier of propagation fields, such as an http request.
carrier
,
String
the key of the field.
key
)

Returns the first value of the given propagation key or returns null.

Method Detail

getback to summary
public String get(C carrier, String key)

Returns the first value of the given propagation key or returns null.

Parameters
carrier:C

carrier of propagation fields, such as an http request.

key:String

the key of the field.

Returns:String

the first value of the given propagation key or returns null.

Annotations
@Nullable
io.micrometer.observation.transport back to summary

public Interface Propagator.Setter<C>

Type Parameters
<C>
carrier of propagation fields, such as an http request

Class that allows to set propagated fields into a carrier.

Setter is stateless and allows to be saved as a constant to avoid runtime allocations.

Since
1.10.0

Method Summary

Modifier and TypeMethod and Description
public void
set(C
holds propagation fields. For example, an outgoing message or http request. To facilitate implementations as java lambdas, this parameter may be null.
carrier
,
String
the key of the field.
key
,
String
the value of the field.
value
)

Replaces a propagated field with the given value.

Method Detail

setback to summary
public void set(C carrier, String key, String value)

Replaces a propagated field with the given value.

For example, a setter for an java.net.HttpURLConnection would be the method reference java.net.HttpURLConnection#addRequestProperty(String, String)

Parameters
carrier:C

holds propagation fields. For example, an outgoing message or http request. To facilitate implementations as java lambdas, this parameter may be null.

key:String

the key of the field.

value:String

the value of the field.