Package io.opencensus.tags
Class Tags
- java.lang.Object
-
- io.opencensus.tags.Tags
-
public final class Tags extends java.lang.ObjectClass for accessing the defaultTagsComponent.- Since:
- 0.8
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Loggerloggerprivate static TagsComponenttagsComponent
-
Constructor Summary
Constructors Modifier Constructor Description privateTags()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static TaggingStategetState()Returns the currentTaggingState.static TaggergetTagger()Returns the defaultTagger.static TagPropagationComponentgetTagPropagationComponent()Returns the defaultTagPropagationComponent.(package private) static TagsComponentloadTagsComponent(java.lang.ClassLoader classLoader)static voidsetState(TaggingState state)Deprecated.This method is deprecated because other libraries could cache the result ofgetState(), use a stale value, and behave incorrectly.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
tagsComponent
private static final TagsComponent tagsComponent
-
-
Method Detail
-
getTagger
public static Tagger getTagger()
Returns the defaultTagger.- Returns:
- the default
Tagger. - Since:
- 0.8
-
getTagPropagationComponent
public static TagPropagationComponent getTagPropagationComponent()
Returns the defaultTagPropagationComponent.- Returns:
- the default
TagPropagationComponent. - Since:
- 0.8
-
getState
public static TaggingState getState()
Returns the currentTaggingState.When no implementation is available,
getStatealways returnsTaggingState.DISABLED.Once
getState()is called, subsequent calls tosetState(TaggingState)will throw anIllegalStateException.- Returns:
- the current
TaggingState. - Since:
- 0.8
-
setState
@Deprecated public static void setState(TaggingState state)
Deprecated.This method is deprecated because other libraries could cache the result ofgetState(), use a stale value, and behave incorrectly. It is only safe to call early in initialization. This method throwsIllegalStateExceptionaftergetState()has been called, in order to limit changes to the result ofgetState().Sets the currentTaggingState.When no implementation is available,
setStatedoes not change the state.- Parameters:
state- the newTaggingState.- Throws:
java.lang.IllegalStateException- ifgetState()was previously called.- Since:
- 0.8
-
loadTagsComponent
static TagsComponent loadTagsComponent(@Nullable java.lang.ClassLoader classLoader)
-
-