Class Tags

java.lang.Object
io.opencensus.tags.Tags

public final class Tags extends Object
Class for accessing the default TagsComponent.
Since:
0.8
  • Field Details

    • logger

      private static final Logger logger
    • tagsComponent

      private static final TagsComponent tagsComponent
  • Constructor Details

    • Tags

      private Tags()
  • Method Details

    • getTagger

      public static Tagger getTagger()
      Returns the default Tagger.
      Returns:
      the default Tagger.
      Since:
      0.8
    • getTagPropagationComponent

      public static TagPropagationComponent getTagPropagationComponent()
      Returns the default TagPropagationComponent.
      Returns:
      the default TagPropagationComponent.
      Since:
      0.8
    • getState

      public static TaggingState getState()
      Returns the current TaggingState.

      When no implementation is available, getState always returns TaggingState.DISABLED.

      Once getState() is called, subsequent calls to setState(TaggingState) will throw an IllegalStateException.

      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 of getState(), use a stale value, and behave incorrectly. It is only safe to call early in initialization. This method throws IllegalStateException after getState() has been called, in order to limit changes to the result of getState().
      Sets the current TaggingState.

      When no implementation is available, setState does not change the state.

      Parameters:
      state - the new TaggingState.
      Throws:
      IllegalStateException - if getState() was previously called.
      Since:
      0.8
    • loadTagsComponent

      static TagsComponent loadTagsComponent(@Nullable ClassLoader classLoader)