@Internal public class MetricTagContext extends Object
MetricContext
Provides similar capability to MDC, i.e. for adding contextual tags onto all metrics generated during the enclosed execution context.
E.g.
try (Closeable t = MetricTagContext.put(MetricTag.optionalOf("projectKey", projectKey))) {
reindexIssue(issueId);
}
Only takes MetricTag.OptionalMetricTags to prevent over collection.| Modifier and Type | Class and Description |
|---|---|
static interface |
MetricTagContext.Closeable
Deprecated.
use
ContextFragment instead, don't use this with new methods, leave existing ones alone for
now for backwards-compatibility. For removal in 5.0 |
| Constructor and Description |
|---|
MetricTagContext() |
| Modifier and Type | Method and Description |
|---|---|
static Set<MetricTag.OptionalMetricTag> |
getAll() |
static MetricTagContext.Closeable |
put(MetricTag.OptionalMetricTag tag)
Deprecated.
Use
put(OptionalTag...), for removal in 5.0.0 |
static ContextFragment |
put(OptionalTag... tags) |
@Nonnull public static ContextFragment put(@Nonnull OptionalTag... tags)
public static MetricTagContext.Closeable put(MetricTag.OptionalMetricTag tag)
put(OptionalTag...), for removal in 5.0.0@Nonnull public static Set<MetricTag.OptionalMetricTag> getAll()
Copyright © 2023 Atlassian. All rights reserved.