Package io.opencensus.tags
Class NoopTags.NoopTagContextTextFormat
java.lang.Object
io.opencensus.tags.propagation.TagContextTextFormat
io.opencensus.tags.NoopTags.NoopTagContextTextFormat
- Enclosing class:
NoopTags
@Immutable
private static final class NoopTags.NoopTagContextTextFormat
extends TagContextTextFormat
-
Nested Class Summary
Nested classes/interfaces inherited from class io.opencensus.tags.propagation.TagContextTextFormat
TagContextTextFormat.Getter<C>, TagContextTextFormat.Setter<C>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final NoopTags.NoopTagContextTextFormat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<C> TagContext
extract
(C carrier, TagContextTextFormat.Getter<C> getter) Extracts the tag context from upstream.fields()
The propagation fields defined.<C> void
inject
(TagContext tagContext, C carrier, TagContextTextFormat.Setter<C> setter) Injects the tag context downstream.
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NoopTagContextTextFormat
private NoopTagContextTextFormat()
-
-
Method Details
-
fields
Description copied from class:TagContextTextFormat
The propagation fields defined. If your carrier is reused, you should delete the fields here before callingTagContextTextFormat.inject(TagContext, Object, Setter)
.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.
- Specified by:
fields
in classTagContextTextFormat
-
inject
public <C> void inject(TagContext tagContext, C carrier, TagContextTextFormat.Setter<C> setter) throws TagContextSerializationException Description copied from class:TagContextTextFormat
Injects the tag context downstream. For example, as http headers.- Specified by:
inject
in classTagContextTextFormat
- Parameters:
tagContext
- the tag context.carrier
- holds propagation fields. For example, an outgoing message or http request.setter
- invoked for each propagation key to add or remove.- Throws:
TagContextSerializationException
- if the given tag context cannot be serialized.
-
extract
public <C> TagContext extract(C carrier, TagContextTextFormat.Getter<C> getter) throws TagContextDeserializationException Description copied from class:TagContextTextFormat
Extracts the tag context from upstream. For example, as http headers.- Specified by:
extract
in classTagContextTextFormat
- Parameters:
carrier
- holds propagation fields. For example, an outgoing message or http request.getter
- invoked for each propagation key to get.- Throws:
TagContextDeserializationException
- if the input is invalid
-