Package io.opencensus.tags
Class Tags
java.lang.Object
io.opencensus.tags.Tags
Class for accessing the default
TagsComponent
.- Since:
- 0.8
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TaggingState
getState()
Returns the currentTaggingState
.static Tagger
Returns the defaultTagger
.static TagPropagationComponent
Returns the defaultTagPropagationComponent
.(package private) static TagsComponent
loadTagsComponent
(ClassLoader classLoader) static void
setState
(TaggingState state) Deprecated.
-
Field Details
-
logger
-
tagsComponent
-
-
Constructor Details
-
Tags
private Tags()
-
-
Method Details
-
getTagger
Returns the defaultTagger
.- Returns:
- the default
Tagger
. - Since:
- 0.8
-
getTagPropagationComponent
Returns the defaultTagPropagationComponent
.- Returns:
- the default
TagPropagationComponent
. - Since:
- 0.8
-
getState
Returns the currentTaggingState
.When no implementation is available,
getState
always returnsTaggingState.DISABLED
.Once
getState()
is called, subsequent calls tosetState(TaggingState)
will throw anIllegalStateException
.- Returns:
- the current
TaggingState
. - Since:
- 0.8
-
setState
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 throwsIllegalStateException
aftergetState()
has been called, in order to limit changes to the result ofgetState()
.Sets the currentTaggingState
.When no implementation is available,
setState
does not change the state.- Parameters:
state
- the newTaggingState
.- Throws:
IllegalStateException
- ifgetState()
was previously called.- Since:
- 0.8
-
loadTagsComponent
-
getState()
, use a stale value, and behave incorrectly.