diff --git a/packages/dd-trace/src/telemetry/metrics.js b/packages/dd-trace/src/telemetry/metrics.js index 34740aa7f2..2c42bc2382 100644 --- a/packages/dd-trace/src/telemetry/metrics.js +++ b/packages/dd-trace/src/telemetry/metrics.js @@ -27,13 +27,18 @@ function hasPoints (metric) { return metric.points.length > 0 } +let versionTag + class Metric { constructor (namespace, metric, common, tags) { this.namespace = namespace.toString() this.metric = common ? metric : `nodejs.${metric}` this.tags = tagArray(tags) if (common) { - this.tags.push(`version:${process.version}`) + if (versionTag === undefined) { + versionTag = `version:${process.version}` + } + this.tags.push(versionTag) } this.common = common