diff --git a/ddtrace/tracer/option.go b/ddtrace/tracer/option.go index db683f6c14..f2799288c6 100644 --- a/ddtrace/tracer/option.go +++ b/ddtrace/tracer/option.go @@ -741,9 +741,12 @@ func SpanType(name string) StartSpanOption { return Tag(ext.SpanType, name) } +var measuredTag = Tag(keyMeasured, 1) + // Measured marks this span to be measured for metrics and stats calculations. func Measured() StartSpanOption { - return Tag(keyMeasured, 1) + // cache a global instance of this tag: saves one alloc/call + return measuredTag } // WithSpanID sets the SpanID on the started span, instead of using a random number.