Skip to content

Commit c13a044

Browse files
committed
Have one version tag in metrics – minor memory saving
1 parent 57f8a10 commit c13a044

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/dd-trace/src/telemetry/metrics.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@ function hasPoints (metric) {
2727
return metric.points.length > 0
2828
}
2929

30+
let versionTag
31+
3032
class Metric {
3133
constructor (namespace, metric, common, tags) {
3234
this.namespace = namespace.toString()
3335
this.metric = common ? metric : `nodejs.${metric}`
3436
this.tags = tagArray(tags)
3537
if (common) {
36-
this.tags.push(`version:${process.version}`)
38+
if (versionTag === undefined) {
39+
versionTag = `version:${process.version}`
40+
}
41+
this.tags.push(versionTag)
3742
}
3843
this.common = common
3944

0 commit comments

Comments
 (0)