Skip to content

Commit 61bc3e3

Browse files
marctcMrAlias
andauthored
Add telemetry distro name & version resource attributes (#897)
* Add telemetry distro name & version resource attributes * Add changelog * Fix integration tests * Fix integration tests * Fix integration tests --------- Co-authored-by: Tyler Yahn <[email protected]>
1 parent b3a02e8 commit 61bc3e3

File tree

9 files changed

+68
-18
lines changed

9 files changed

+68
-18
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ OpenTelemetry Go Automatic Instrumentation adheres to [Semantic Versioning](http
1414
- Support `google.golang.org/grpc` `1.66.0-dev`. ([#872](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/872))
1515
- Add support to log level through command line flag. ([#842](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/842))
1616
- The `WithLogLevel` function and `LogLevel` type are added to set the log level for `Instrumentation`. ([#842](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/842))
17+
- Add telemetry distro name & version resource attributes. ([#897](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/897))
1718

1819
### Fixed
1920

instrumentation.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp"
3737
"go.opentelemetry.io/otel/sdk/resource"
3838
"go.opentelemetry.io/otel/sdk/trace"
39-
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
39+
semconv "go.opentelemetry.io/otel/semconv/v1.22.0"
4040

4141
"go.opentelemetry.io/auto/internal/pkg/instrumentation"
4242
"go.opentelemetry.io/auto/internal/pkg/opentelemetry"
@@ -281,7 +281,8 @@ func (c instConfig) res(bi *buildinfo.BuildInfo) *resource.Resource {
281281
attrs := []attribute.KeyValue{
282282
semconv.ServiceNameKey.String(c.serviceName),
283283
semconv.TelemetrySDKLanguageGo,
284-
semconv.TelemetryAutoVersionKey.String(Version()),
284+
semconv.TelemetryDistroVersionKey.String(Version()),
285+
semconv.TelemetryDistroNameKey.String("opentelemetry-go-instrumentation"),
285286
semconv.ProcessRuntimeName(runName),
286287
semconv.ProcessRuntimeVersion(runVer),
287288
semconv.ProcessRuntimeDescription(runDesc),

internal/test/e2e/databasesql/traces.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
}
2929
},
3030
{
31-
"key": "telemetry.auto.version",
31+
"key": "telemetry.distro.name",
32+
"value": {
33+
"stringValue": "opentelemetry-go-instrumentation"
34+
}
35+
},
36+
{
37+
"key": "telemetry.distro.version",
3238
"value": {
3339
"stringValue": "v0.13.0-alpha"
3440
}
@@ -41,7 +47,7 @@
4147
}
4248
]
4349
},
44-
"schemaUrl": "https://opentelemetry.io/schemas/1.21.0",
50+
"schemaUrl": "https://opentelemetry.io/schemas/1.22.0",
4551
"scopeSpans": [
4652
{
4753
"scope": {

internal/test/e2e/gin/traces.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
}
2929
},
3030
{
31-
"key": "telemetry.auto.version",
31+
"key": "telemetry.distro.name",
32+
"value": {
33+
"stringValue": "opentelemetry-go-instrumentation"
34+
}
35+
},
36+
{
37+
"key": "telemetry.distro.version",
3238
"value": {
3339
"stringValue": "v0.13.0-alpha"
3440
}
@@ -41,7 +47,7 @@
4147
}
4248
]
4349
},
44-
"schemaUrl": "https://opentelemetry.io/schemas/1.21.0",
50+
"schemaUrl": "https://opentelemetry.io/schemas/1.22.0",
4551
"scopeSpans": [
4652
{
4753
"scope": {

internal/test/e2e/grpc/traces.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
}
2929
},
3030
{
31-
"key": "telemetry.auto.version",
31+
"key": "telemetry.distro.name",
32+
"value": {
33+
"stringValue": "opentelemetry-go-instrumentation"
34+
}
35+
},
36+
{
37+
"key": "telemetry.distro.version",
3238
"value": {
3339
"stringValue": "v0.13.0-alpha"
3440
}
@@ -41,7 +47,7 @@
4147
}
4248
]
4349
},
44-
"schemaUrl": "https://opentelemetry.io/schemas/1.21.0",
50+
"schemaUrl": "https://opentelemetry.io/schemas/1.22.0",
4551
"scopeSpans": [
4652
{
4753
"scope": {

internal/test/e2e/kafka-go/traces.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
}
2929
},
3030
{
31-
"key": "telemetry.auto.version",
31+
"key": "telemetry.distro.name",
32+
"value": {
33+
"stringValue": "opentelemetry-go-instrumentation"
34+
}
35+
},
36+
{
37+
"key": "telemetry.distro.version",
3238
"value": {
3339
"stringValue": "v0.13.0-alpha"
3440
}
@@ -41,7 +47,7 @@
4147
}
4248
]
4349
},
44-
"schemaUrl": "https://opentelemetry.io/schemas/1.21.0",
50+
"schemaUrl": "https://opentelemetry.io/schemas/1.22.0",
4551
"scopeSpans": [
4652
{
4753
"scope": {
@@ -163,7 +169,13 @@
163169
}
164170
},
165171
{
166-
"key": "telemetry.auto.version",
172+
"key": "telemetry.distro.name",
173+
"value": {
174+
"stringValue": "opentelemetry-go-instrumentation"
175+
}
176+
},
177+
{
178+
"key": "telemetry.distro.version",
167179
"value": {
168180
"stringValue": "v0.13.0-alpha"
169181
}
@@ -176,7 +188,7 @@
176188
}
177189
]
178190
},
179-
"schemaUrl": "https://opentelemetry.io/schemas/1.21.0",
191+
"schemaUrl": "https://opentelemetry.io/schemas/1.22.0",
180192
"scopeSpans": [
181193
{
182194
"scope": {

internal/test/e2e/nethttp/traces.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
}
2929
},
3030
{
31-
"key": "telemetry.auto.version",
31+
"key": "telemetry.distro.name",
32+
"value": {
33+
"stringValue": "opentelemetry-go-instrumentation"
34+
}
35+
},
36+
{
37+
"key": "telemetry.distro.version",
3238
"value": {
3339
"stringValue": "v0.13.0-alpha"
3440
}
@@ -41,7 +47,7 @@
4147
}
4248
]
4349
},
44-
"schemaUrl": "https://opentelemetry.io/schemas/1.21.0",
50+
"schemaUrl": "https://opentelemetry.io/schemas/1.22.0",
4551
"scopeSpans": [
4652
{
4753
"scope": {

internal/test/e2e/nethttp_custom/traces.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
}
2929
},
3030
{
31-
"key": "telemetry.auto.version",
31+
"key": "telemetry.distro.name",
32+
"value": {
33+
"stringValue": "opentelemetry-go-instrumentation"
34+
}
35+
},
36+
{
37+
"key": "telemetry.distro.version",
3238
"value": {
3339
"stringValue": "v0.13.0-alpha"
3440
}
@@ -41,7 +47,7 @@
4147
}
4248
]
4349
},
44-
"schemaUrl": "https://opentelemetry.io/schemas/1.21.0",
50+
"schemaUrl": "https://opentelemetry.io/schemas/1.22.0",
4551
"scopeSpans": [
4652
{
4753
"scope": {

internal/test/e2e/otelglobal/traces.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
}
2929
},
3030
{
31-
"key": "telemetry.auto.version",
31+
"key": "telemetry.distro.name",
32+
"value": {
33+
"stringValue": "opentelemetry-go-instrumentation"
34+
}
35+
},
36+
{
37+
"key": "telemetry.distro.version",
3238
"value": {
3339
"stringValue": "v0.13.0-alpha"
3440
}
@@ -41,7 +47,7 @@
4147
}
4248
]
4349
},
44-
"schemaUrl": "https://opentelemetry.io/schemas/1.21.0",
50+
"schemaUrl": "https://opentelemetry.io/schemas/1.22.0",
4551
"scopeSpans": [
4652
{
4753
"scope": {

0 commit comments

Comments
 (0)