Skip to content

Commit 9f803ed

Browse files
committed
Upgrade otellambda semconv
1 parent e701e33 commit 9f803ed

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1818
- The semantic conventions used by `go.opentelemetry.io/contrib/detectors/aws/ecs` have been upgraded to v1.21.0. (#4265)
1919
- The semantic conventions used by `go.opentelemetry.io/contrib/detectors/aws/eks` have been upgraded to v1.21.0. (#4265)
2020
- The semantic conventions used by `go.opentelemetry.io/contrib/detectors/aws/lambda` have been upgraded to v1.21.0. (#4265)
21+
- The semantic conventions used by `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-lambda-go/otellambda` have been upgraded to v1.21.0. (#4265)
22+
- The `faas.execution` attribute is now `faas.invocation.id`.
23+
- The `faas.id` attribute is now `aws.lambda.invoked_arn`.
2124

2225
## [1.18.0/0.43.0/0.12.0] - 2023-08-28
2326

instrumentation/github.com/aws/aws-lambda-go/otellambda/lambda.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"go.opentelemetry.io/otel"
2626
"go.opentelemetry.io/otel/attribute"
27-
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
27+
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
2828
"go.opentelemetry.io/otel/trace"
2929
)
3030

@@ -72,15 +72,15 @@ func (i *instrumentor) tracingBegin(ctx context.Context, eventJSON []byte) (cont
7272
}
7373
if lc != nil {
7474
ctxRequestID := lc.AwsRequestID
75-
attributes = append(attributes, semconv.FaaSExecution(ctxRequestID))
75+
attributes = append(attributes, semconv.FaaSInvocationID(ctxRequestID))
7676

7777
// Some resource attrs added as span attrs because lambda
7878
// resource detectors are created before a lambda
7979
// invocation and therefore lack lambdacontext.
8080
// Create these attrs upon first invocation
8181
if len(i.resAttrs) == 0 {
8282
ctxFunctionArn := lc.InvokedFunctionArn
83-
attributes = append(attributes, semconv.FaaSID(ctxFunctionArn))
83+
attributes = append(attributes, semconv.AWSLambdaInvokedARN(ctxFunctionArn))
8484
arnParts := strings.Split(ctxFunctionArn, ":")
8585
if len(arnParts) >= 5 {
8686
attributes = append(attributes, semconv.CloudAccountID(arnParts[4]))

instrumentation/github.com/aws/aws-lambda-go/otellambda/test/lambda_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import (
4040
"go.opentelemetry.io/otel/sdk/resource"
4141
sdktrace "go.opentelemetry.io/otel/sdk/trace"
4242
"go.opentelemetry.io/otel/sdk/trace/tracetest"
43-
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
43+
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
4444
"go.opentelemetry.io/otel/trace"
4545
)
4646

0 commit comments

Comments
 (0)