Class CorrelationContextFormat
java.lang.Object
io.opencensus.tags.propagation.TagContextTextFormat
io.opencensus.implcore.tags.propagation.CorrelationContextFormat
Implementation of the W3C correlation context propagation protocol. See w3c/correlation-context.
-
Nested Class Summary
Nested classes/interfaces inherited from class TagContextTextFormat
TagContextTextFormat.Getter<C>, TagContextTextFormat.Setter<C> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) static final int(package private) static final TagMetadataprivate final CurrentStateprivate static final charprivate static final charprivate static final com.google.common.base.Splitterprivate static final charprivate static final intprivate static final com.google.common.base.Splitterprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voiddecodeTag(String stringTag, Map<TagKey, TagValueWithMetadata> tags) private static intencodeTag(Tag tag, StringBuilder stringBuilder) <C> TagContextextract(C carrier, TagContextTextFormat.Getter<C> getter) Extracts the tag context from upstream.fields()The propagation fields defined.<C> voidinject(TagContext tagContext, C carrier, TagContextTextFormat.Setter<C> setter) Injects the tag context downstream.
-
Field Details
-
CORRELATION_CONTEXT
- See Also:
-
FIELDS
-
MAX_NUMBER_OF_TAGS
static final int MAX_NUMBER_OF_TAGS- See Also:
-
TAG_SERIALIZED_SIZE_LIMIT
private static final int TAG_SERIALIZED_SIZE_LIMIT- See Also:
-
TAGCONTEXT_SERIALIZED_SIZE_LIMIT
private static final int TAGCONTEXT_SERIALIZED_SIZE_LIMIT- See Also:
-
TAG_KEY_VALUE_DELIMITER
private static final char TAG_KEY_VALUE_DELIMITER- See Also:
-
TAG_DELIMITER
private static final char TAG_DELIMITER- See Also:
-
TAG_KEY_VALUE_SPLITTER
private static final com.google.common.base.Splitter TAG_KEY_VALUE_SPLITTER -
TAG_SPLITTER
private static final com.google.common.base.Splitter TAG_SPLITTER -
TAG_PROPERTIES_DELIMITER
private static final char TAG_PROPERTIES_DELIMITER- See Also:
-
METADATA_UNLIMITED_PROPAGATION
-
state
-
-
Constructor Details
-
CorrelationContextFormat
CorrelationContextFormat(CurrentState state)
-
-
Method Details
-
fields
Description copied from class:TagContextTextFormatThe 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:
fieldsin classTagContextTextFormat
-
inject
public <C> void inject(TagContext tagContext, C carrier, TagContextTextFormat.Setter<C> setter) throws TagContextSerializationException Description copied from class:TagContextTextFormatInjects the tag context downstream. For example, as http headers.- Specified by:
injectin 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.
-
encodeTag
-
extract
public <C> TagContext extract(C carrier, TagContextTextFormat.Getter<C> getter) throws TagContextDeserializationException Description copied from class:TagContextTextFormatExtracts the tag context from upstream. For example, as http headers.- Specified by:
extractin 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
-
decodeTag
-