Package com.atlassian.util.profiling
Class MetricTagContext
java.lang.Object
com.atlassian.util.profiling.MetricTagContext
Internal only version of
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.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<MetricTag.OptionalMetricTag>getAll()static ContextFragmentput(OptionalTag... tags) static MetricTagContext.CloseableDeprecated.Useput(OptionalTag...), for removal in 5.0.0
-
Constructor Details
-
MetricTagContext
public MetricTagContext()
-
-
Method Details
-
put
- Since:
- 4.6.0
-
put
Deprecated.Useput(OptionalTag...), for removal in 5.0.0 -
getAll
-
ContextFragmentinstead, don't use this with new methods, leave existing ones alone for now for backwards-compatibility.