diff --git a/CHANGELOG.md b/CHANGELOG.md index efa1fb42c..e4713beee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ OpenTelemetry Go Automatic Instrumentation adheres to [Semantic Versioning](http - Support `google.golang.org/grpc` `1.66.0-dev`. ([#872](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/872)) - Add support to log level through command line flag. ([#842](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/842)) - 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)) +- Add telemetry distro name & version resource attributes. ([#897](https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/897)) ### Fixed diff --git a/instrumentation.go b/instrumentation.go index 3378d2c7a..b16510f23 100644 --- a/instrumentation.go +++ b/instrumentation.go @@ -36,7 +36,7 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" "go.opentelemetry.io/otel/sdk/resource" "go.opentelemetry.io/otel/sdk/trace" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.22.0" "go.opentelemetry.io/auto/internal/pkg/instrumentation" "go.opentelemetry.io/auto/internal/pkg/opentelemetry" @@ -281,7 +281,8 @@ func (c instConfig) res(bi *buildinfo.BuildInfo) *resource.Resource { attrs := []attribute.KeyValue{ semconv.ServiceNameKey.String(c.serviceName), semconv.TelemetrySDKLanguageGo, - semconv.TelemetryAutoVersionKey.String(Version()), + semconv.TelemetryDistroVersionKey.String(Version()), + semconv.TelemetryDistroNameKey.String("opentelemetry-go-instrumentation"), semconv.ProcessRuntimeName(runName), semconv.ProcessRuntimeVersion(runVer), semconv.ProcessRuntimeDescription(runDesc), diff --git a/internal/test/e2e/databasesql/traces.json b/internal/test/e2e/databasesql/traces.json index 4a8838753..c21898f0f 100644 --- a/internal/test/e2e/databasesql/traces.json +++ b/internal/test/e2e/databasesql/traces.json @@ -28,7 +28,13 @@ } }, { - "key": "telemetry.auto.version", + "key": "telemetry.distro.name", + "value": { + "stringValue": "opentelemetry-go-instrumentation" + } + }, + { + "key": "telemetry.distro.version", "value": { "stringValue": "v0.13.0-alpha" } @@ -41,7 +47,7 @@ } ] }, - "schemaUrl": "https://opentelemetry.io/schemas/1.21.0", + "schemaUrl": "https://opentelemetry.io/schemas/1.22.0", "scopeSpans": [ { "scope": { diff --git a/internal/test/e2e/gin/traces.json b/internal/test/e2e/gin/traces.json index 296e8ad3d..bfb81aef7 100644 --- a/internal/test/e2e/gin/traces.json +++ b/internal/test/e2e/gin/traces.json @@ -28,7 +28,13 @@ } }, { - "key": "telemetry.auto.version", + "key": "telemetry.distro.name", + "value": { + "stringValue": "opentelemetry-go-instrumentation" + } + }, + { + "key": "telemetry.distro.version", "value": { "stringValue": "v0.13.0-alpha" } @@ -41,7 +47,7 @@ } ] }, - "schemaUrl": "https://opentelemetry.io/schemas/1.21.0", + "schemaUrl": "https://opentelemetry.io/schemas/1.22.0", "scopeSpans": [ { "scope": { diff --git a/internal/test/e2e/grpc/traces.json b/internal/test/e2e/grpc/traces.json index 96e8e58d1..b3c0047d7 100644 --- a/internal/test/e2e/grpc/traces.json +++ b/internal/test/e2e/grpc/traces.json @@ -28,7 +28,13 @@ } }, { - "key": "telemetry.auto.version", + "key": "telemetry.distro.name", + "value": { + "stringValue": "opentelemetry-go-instrumentation" + } + }, + { + "key": "telemetry.distro.version", "value": { "stringValue": "v0.13.0-alpha" } @@ -41,7 +47,7 @@ } ] }, - "schemaUrl": "https://opentelemetry.io/schemas/1.21.0", + "schemaUrl": "https://opentelemetry.io/schemas/1.22.0", "scopeSpans": [ { "scope": { diff --git a/internal/test/e2e/kafka-go/traces.json b/internal/test/e2e/kafka-go/traces.json index 9001f7028..d976f9e71 100644 --- a/internal/test/e2e/kafka-go/traces.json +++ b/internal/test/e2e/kafka-go/traces.json @@ -28,7 +28,13 @@ } }, { - "key": "telemetry.auto.version", + "key": "telemetry.distro.name", + "value": { + "stringValue": "opentelemetry-go-instrumentation" + } + }, + { + "key": "telemetry.distro.version", "value": { "stringValue": "v0.13.0-alpha" } @@ -41,7 +47,7 @@ } ] }, - "schemaUrl": "https://opentelemetry.io/schemas/1.21.0", + "schemaUrl": "https://opentelemetry.io/schemas/1.22.0", "scopeSpans": [ { "scope": { @@ -163,7 +169,13 @@ } }, { - "key": "telemetry.auto.version", + "key": "telemetry.distro.name", + "value": { + "stringValue": "opentelemetry-go-instrumentation" + } + }, + { + "key": "telemetry.distro.version", "value": { "stringValue": "v0.13.0-alpha" } @@ -176,7 +188,7 @@ } ] }, - "schemaUrl": "https://opentelemetry.io/schemas/1.21.0", + "schemaUrl": "https://opentelemetry.io/schemas/1.22.0", "scopeSpans": [ { "scope": { diff --git a/internal/test/e2e/nethttp/traces.json b/internal/test/e2e/nethttp/traces.json index ae79f7fac..6681ecfee 100644 --- a/internal/test/e2e/nethttp/traces.json +++ b/internal/test/e2e/nethttp/traces.json @@ -28,7 +28,13 @@ } }, { - "key": "telemetry.auto.version", + "key": "telemetry.distro.name", + "value": { + "stringValue": "opentelemetry-go-instrumentation" + } + }, + { + "key": "telemetry.distro.version", "value": { "stringValue": "v0.13.0-alpha" } @@ -41,7 +47,7 @@ } ] }, - "schemaUrl": "https://opentelemetry.io/schemas/1.21.0", + "schemaUrl": "https://opentelemetry.io/schemas/1.22.0", "scopeSpans": [ { "scope": { diff --git a/internal/test/e2e/nethttp_custom/traces.json b/internal/test/e2e/nethttp_custom/traces.json index 4dd7d1fa3..931b00027 100644 --- a/internal/test/e2e/nethttp_custom/traces.json +++ b/internal/test/e2e/nethttp_custom/traces.json @@ -28,7 +28,13 @@ } }, { - "key": "telemetry.auto.version", + "key": "telemetry.distro.name", + "value": { + "stringValue": "opentelemetry-go-instrumentation" + } + }, + { + "key": "telemetry.distro.version", "value": { "stringValue": "v0.13.0-alpha" } @@ -41,7 +47,7 @@ } ] }, - "schemaUrl": "https://opentelemetry.io/schemas/1.21.0", + "schemaUrl": "https://opentelemetry.io/schemas/1.22.0", "scopeSpans": [ { "scope": { diff --git a/internal/test/e2e/otelglobal/traces.json b/internal/test/e2e/otelglobal/traces.json index edcfbcec9..7f648efae 100644 --- a/internal/test/e2e/otelglobal/traces.json +++ b/internal/test/e2e/otelglobal/traces.json @@ -28,7 +28,13 @@ } }, { - "key": "telemetry.auto.version", + "key": "telemetry.distro.name", + "value": { + "stringValue": "opentelemetry-go-instrumentation" + } + }, + { + "key": "telemetry.distro.version", "value": { "stringValue": "v0.13.0-alpha" } @@ -41,7 +47,7 @@ } ] }, - "schemaUrl": "https://opentelemetry.io/schemas/1.21.0", + "schemaUrl": "https://opentelemetry.io/schemas/1.22.0", "scopeSpans": [ { "scope": {