Skip to content

Commit

Permalink
ddtracer/tracer: fix appending 'tracer_version' to the statsd tags (#…
Browse files Browse the repository at this point in the history
…2801)

Co-authored-by: Diana Shevchenko <[email protected]>
  • Loading branch information
nsrip-dd and dianashevchenko authored Jul 29, 2024
1 parent 70fa492 commit f8a22c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ddtrace/tracer/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ func statsTags(c *config) []string {
}
}
globalconfig.SetStatsTags(tags)
tags = append(tags, version.Tag)
tags = append(tags, "tracer_version:"+version.Tag)
if c.serviceName != "" {
tags = append(tags, "service:"+c.serviceName)
}
Expand Down
3 changes: 2 additions & 1 deletion ddtrace/tracer/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,7 @@ func TestStatsTags(t *testing.T) {
assert.Contains(tags, "service:serviceName")
assert.Contains(tags, "env:envName")
assert.Contains(tags, "host:hostName")
assert.Contains(tags, "tracer_version:"+version.Tag)

st := globalconfig.StatsTags()
// all of the tracer tags except `service` and `version` should be on `st`
Expand All @@ -1295,7 +1296,7 @@ func TestStatsTags(t *testing.T) {
assert.Contains(st, "host:hostName")
assert.Contains(st, "lang:go")
assert.Contains(st, "lang_version:"+runtime.Version())
assert.NotContains(st, "version:"+version.Tag)
assert.NotContains(st, "tracer_version:"+version.Tag)
assert.NotContains(st, "service:serviceName")
}

Expand Down

0 comments on commit f8a22c3

Please sign in to comment.