Skip to content

Commit

Permalink
Have one version tag in metrics (#4857)
Browse files Browse the repository at this point in the history
  • Loading branch information
szegedi authored and rochdev committed Nov 13, 2024
1 parent fb76c91 commit e2addb5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/dd-trace/src/telemetry/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e2addb5

Please sign in to comment.