Interface SystemTagsManager


public interface SystemTagsManager
Deals with global and app-level tags to be included in the external representation for all metrics.
  • Method Details

    • create

      static SystemTagsManager create(MetricsConfig metricsConfig)
      Creates a new system tags manager using the provided metrics settings.
      Parameters:
      metricsConfig - settings containing the global and app-level tags (if any)
      Returns:
      new tags manager
    • create

      static SystemTagsManager create(MetricsConfig metricsConfig, MetricsFactory metricsFactory)
      Creates a new system tags manager using the provided metrics settings and metrics factory.
      Parameters:
      metricsConfig - settings containing the global and app-level tags (if any)
      metricsFactory - factory to use for creating tags
      Returns:
      new tags manager
    • instance

      @Deprecated(since="27.0.0", forRemoval=true) static SystemTagsManager instance()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 27.0.0, for removal. Use Services.get(SystemTagsManager.class) for the shared system tags manager, or create(MetricsConfig) for a non-global instance.
      Returns the initialized instance of the tags manager.
      Returns:
      current instance of the tags manager
    • instance

      @Deprecated(since="27.0.0", forRemoval=true) static SystemTagsManager instance(MetricsConfig metricsConfig)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the current ServiceRegistry-backed instance, ignoring the provided configuration.
      Parameters:
      metricsConfig - ignored; must not be null
      Returns:
      tags manager from the service registry
    • onChange

      @Deprecated(since="27.0.0", forRemoval=true) static void onChange(Consumer<SystemTagsManager> ignoredChangeListener)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 27.0.0, for removal. Obtain the shared manager from Services.get(SystemTagsManager.class). To use different metrics configuration, create a non-global manager using create(MetricsConfig).
      No-op retained for compatibility. The service registry owns one immutable shared system tags manager.
      Parameters:
      ignoredChangeListener - ignored listener; must not be null
    • scopeTag

      @Deprecated(forRemoval=true, since="27.0.0") default Optional<Tag> scopeTag(Optional<String> candidateScope)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Core metrics does not manage scope tags, and this method will be removed.
      Always returns empty because core metrics does not manage scope tags.
      Parameters:
      candidateScope - ignored; must not be null
      Returns:
      empty
    • withScopeTag

      @Deprecated(forRemoval=true, since="27.0.0") default Iterable<Map.Entry<String,String>> withScopeTag(Iterable<Map.Entry<String,String>> tags, String scope)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No-op, will be removed.
      No-op, will be removed.
      Parameters:
      tags - original tags; must not be null
      scope - ignored; must not be null
      Returns:
      provided tags
    • withScopeTag

      @Deprecated(forRemoval=true, since="27.0.0") default Iterable<Tag> withScopeTag(Iterable<Tag> tags, Optional<String> explicitScope)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No-op, will be removed.
      No-op, will be removed.
      Parameters:
      tags - original tags; must not be null
      explicitScope - ignored; must not be null
      Returns:
      provided tags
    • withoutSystemTags

      Iterable<Tag> withoutSystemTags(Iterable<Tag> tags)
      Returns an Iterable of Tag omitting any system tags.
      Parameters:
      tags - tags to filter
      Returns:
      tags without the system tags
    • withoutSystemOrScopeTags

      @Deprecated(forRemoval=true, since="27.0.0") default Iterable<Tag> withoutSystemOrScopeTags(Iterable<Tag> tags)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use withoutSystemTags(Iterable). Scope tags are treated as ordinary tags, and this method will be removed.
      Returns tags without system tags. Scope tags are treated as ordinary tags.
      Parameters:
      tags - tags to filter; must not be null
      Returns:
      non-null tags without system tags
    • displayTags

      Iterable<Tag> displayTags()
      Returns an Iterable of Tag representing the any system tags configured for display (for example, an app tag or global tags set through configuration).
      Returns:
      system tags
    • displayTagPairs

      default Map<String,String> displayTagPairs()
      Returns name/value pairs of system tags, avoiding constructing the provider's Tag implementations for each.
      Returns:
      system tag name/value pairs
    • reservedTagNamesUsed

      Collection<String> reservedTagNamesUsed(Collection<String> tagNames)
      Scans the provided tag names and throws an exception if any is a reserved tag name.
      Parameters:
      tagNames - tag names
      Returns:
      reserved tag names present in the provided tag names
    • assignScope

      @Deprecated(forRemoval=true, since="27.0.0") default void assignScope(String scope, Function<Tag,?> consumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No-op, will be removed.
      No-op, will be removed.
      Parameters:
      scope - ignored; must not be null
      consumer - ignored; must not be null
    • effectiveScope

      @Deprecated(forRemoval=true, since="27.0.0") default Optional<String> effectiveScope(Optional<String> candidateScope)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Core metrics does not assign scopes, and this method will be removed.
      Always returns empty because core metrics does not assign scopes.
      Parameters:
      candidateScope - ignored; must not be null
      Returns:
      empty
    • effectiveScope

      @Deprecated(forRemoval=true, since="27.0.0") default Optional<String> effectiveScope(Optional<String> explicitScope, Iterable<Tag> tags)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Core metrics does not assign scopes, and this method will be removed.
      Always returns empty because core metrics does not assign scopes.
      Parameters:
      explicitScope - ignored; must not be null
      tags - ignored; must not be null
      Returns:
      empty
    • scopeTagName

      @Deprecated(forRemoval=true, since="27.0.0") default Optional<String> scopeTagName()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Core metrics does not manage scope tags, and this method will be removed.
      Always returns empty because core metrics does not manage scope tags.
      Returns:
      empty