Skip to content

Commit

Permalink
Remove version tag in telemetry metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
smola committed Mar 10, 2025
1 parent bfed02a commit 1935553
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 36 deletions.
8 changes: 0 additions & 8 deletions packages/dd-trace/src/telemetry/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,11 @@ 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) {
if (versionTag === undefined) {
versionTag = `version:${process.version}`
}
this.tags.push(versionTag)
}
this.common = common

this.points = []
Expand Down
42 changes: 14 additions & 28 deletions packages/dd-trace/test/telemetry/metrics.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ describe('metrics', () => {
interval: undefined,
type: 'count',
tags: [
'bar:baz',
`version:${process.version}`
'bar:baz'
],
common: true
}
Expand All @@ -83,8 +82,7 @@ describe('metrics', () => {
interval: undefined,
type: 'count',
tags: [
'bux:bax',
`version:${process.version}`
'bux:bax'
],
common: true
}
Expand Down Expand Up @@ -128,8 +126,7 @@ describe('metrics', () => {
interval: undefined,
type: 'count',
tags: [
'bar:baz',
`version:${process.version}`
'bar:baz'
],
common: true
}
Expand All @@ -145,8 +142,7 @@ describe('metrics', () => {
interval: undefined,
type: 'count',
tags: [
'bux:bax',
`version:${process.version}`
'bux:bax'
],
common: true
}
Expand Down Expand Up @@ -250,8 +246,7 @@ describe('metrics', () => {
interval: undefined,
type: 'count',
tags: [
'bar:baz',
`version:${process.version}`
'bar:baz'
],
common: true
},
Expand All @@ -261,8 +256,7 @@ describe('metrics', () => {
interval: undefined,
type: 'count',
tags: [
'bux:bax',
`version:${process.version}`
'bux:bax'
],
common: true
}
Expand Down Expand Up @@ -298,8 +292,7 @@ describe('metrics', () => {
metric: 'name',
tags: [
'foo:bar',
'baz:buz',
`version:${process.version}`
'baz:buz'
],
common: true,
points: []
Expand Down Expand Up @@ -405,8 +398,7 @@ describe('metrics', () => {
type: 'count',
tags: [
'foo:bar',
'baz:buz',
`version:${process.version}`
'baz:buz'
],
common: true
})
Expand All @@ -427,8 +419,7 @@ describe('metrics', () => {
metric: 'name',
tags: [
'foo:bar',
'baz:buz',
`version:${process.version}`
'baz:buz'
],
common: true,
points: []
Expand Down Expand Up @@ -477,8 +468,7 @@ describe('metrics', () => {
common: true,
tags: [
'foo:bar',
'baz:buz',
`version:${process.version}`
'baz:buz'
]
})
})
Expand All @@ -498,8 +488,7 @@ describe('metrics', () => {
metric: 'name',
tags: [
'foo:bar',
'baz:buz',
`version:${process.version}`
'baz:buz'
],
common: true,
points: []
Expand Down Expand Up @@ -567,8 +556,7 @@ describe('metrics', () => {
type: 'gauge',
tags: [
'foo:bar',
'baz:buz',
`version:${process.version}`
'baz:buz'
],
common: true
})
Expand All @@ -589,8 +577,7 @@ describe('metrics', () => {
metric: 'name',
tags: [
'foo:bar',
'baz:buz',
`version:${process.version}`
'baz:buz'
],
common: true,
points: [],
Expand Down Expand Up @@ -638,8 +625,7 @@ describe('metrics', () => {
type: 'rate',
tags: [
'foo:bar',
'baz:buz',
`version:${process.version}`
'baz:buz'
],
common: true
})
Expand Down

0 comments on commit 1935553

Please sign in to comment.