Class MetricTagContext

java.lang.Object
com.atlassian.util.profiling.MetricTagContext

@Internal public class MetricTagContext extends Object
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.