Interface SystemTagsManager
public interface SystemTagsManager
Deals with global and app-level tags to be included in the external representation for all metrics.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidassignScope(String scope, Function<Tag, ?> consumer) Deprecated, for removal: This API element is subject to removal in a future version.No-op, will be removed.static SystemTagsManagercreate(MetricsConfig metricsConfig) Creates a new system tags manager using the provided metrics settings.static SystemTagsManagercreate(MetricsConfig metricsConfig, MetricsFactory metricsFactory) Creates a new system tags manager using the provided metrics settings and metrics factory.Returns name/value pairs of system tags, avoiding constructing the provider'sTagimplementations for each.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.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.static SystemTagsManagerinstance()Deprecated, for removal: This API element is subject to removal in a future version.since 27.0.0, for removal.static SystemTagsManagerinstance(MetricsConfig metricsConfig) Deprecated, for removal: This API element is subject to removal in a future version.useServices.get(SystemTagsManager.class)insteadstatic voidonChange(Consumer<SystemTagsManager> ignoredChangeListener) Deprecated, for removal: This API element is subject to removal in a future version.since 27.0.0, for removal.reservedTagNamesUsed(Collection<String> tagNames) Scans the provided tag names and throws an exception if any is a reserved tag name.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.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.withoutSystemOrScopeTags(Iterable<Tag> tags) Deprecated, for removal: This API element is subject to removal in a future version.withoutSystemTags(Iterable<Tag> tags) 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.Deprecated, for removal: This API element is subject to removal in a future version.No-op, will be removed.
-
Method Details
-
create
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
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, for removal: This API element is subject to removal in a future version.since 27.0.0, for removal. UseServices.get(SystemTagsManager.class)for the shared system tags manager, orcreate(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.useServices.get(SystemTagsManager.class)insteadReturns the currentServiceRegistry-backed instance, ignoring the provided configuration.- Parameters:
metricsConfig- ignored; must not benull- 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 fromServices.get(SystemTagsManager.class). To use different metrics configuration, create a non-global manager usingcreate(MetricsConfig).No-op retained for compatibility. The service registry owns one immutable shared system tags manager.- Parameters:
ignoredChangeListener- ignored listener; must not benull
-
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 benull- 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 benullscope- ignored; must not benull- 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 benullexplicitScope- ignored; must not benull- Returns:
- provided tags
-
withoutSystemTags
-
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.UsewithoutSystemTags(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 benull- Returns:
- non-null tags without system tags
-
displayTags
-
displayTagPairs
-
reservedTagNamesUsed
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 benullconsumer- ignored; must not benull
-
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 benull- 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 benulltags- ignored; must not benull- Returns:
- empty
-
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
-