Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AWS detector and instrumentation semconv to v1.21.0 #4265

Merged
merged 5 commits into from Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,17 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Add the new `go.opentelemetry.io/contrib/instrgen` package to provide auto-generated source code instrumentation. (#3068, #3108)

### Changed

- The semantic conventions used by `go.opentelemetry.io/contrib/detectors/aws/ec2` have been upgraded to v1.21.0. (#4265)
- The semantic conventions used by `go.opentelemetry.io/contrib/detectors/aws/ecs` have been upgraded to v1.21.0. (#4265)
- The semantic conventions used by `go.opentelemetry.io/contrib/detectors/aws/eks` have been upgraded to v1.21.0. (#4265)
- The semantic conventions used by `go.opentelemetry.io/contrib/detectors/aws/lambda` have been upgraded to v1.21.0. (#4265)
- 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)
- The `faas.execution` attribute is now `faas.invocation_id`.
- The `faas.id` attribute is now `aws.lambda.invoked_arn`.
- The semantic conventions used by `go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` have been upgraded to v1.21.0. (#4265)

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

### Added
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/ec2/ec2.go
Expand Up @@ -25,7 +25,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

type config struct {
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/ec2/ec2_test.go
Expand Up @@ -28,7 +28,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

func TestAWS_Detect(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/ecs/ecs.go
Expand Up @@ -27,7 +27,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/ecs/ecs_test.go
Expand Up @@ -21,7 +21,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"

metadata "github.com/brunoscheufler/aws-ecs-metadata-go"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/ecs/test/ecs_test.go
Expand Up @@ -25,7 +25,7 @@ import (
ecs "go.opentelemetry.io/contrib/detectors/aws/ecs"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/eks/detector.go
Expand Up @@ -27,7 +27,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/eks/detector_test.go
Expand Up @@ -24,7 +24,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

type MockDetectorUtils struct {
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/lambda/detector.go
Expand Up @@ -22,7 +22,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

// For a complete list of reserved environment variables in Lambda, see:
Expand Down
2 changes: 1 addition & 1 deletion detectors/aws/lambda/detector_test.go
Expand Up @@ -23,7 +23,7 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

// successfully return resource when process is running on Amazon Lambda environment.
Expand Down
Expand Up @@ -24,7 +24,7 @@ import (

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
"go.opentelemetry.io/otel/trace"
)

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

// Some resource attrs added as span attrs because lambda
// resource detectors are created before a lambda
// invocation and therefore lack lambdacontext.
// Create these attrs upon first invocation
if len(i.resAttrs) == 0 {
ctxFunctionArn := lc.InvokedFunctionArn
attributes = append(attributes, semconv.FaaSID(ctxFunctionArn))
attributes = append(attributes, semconv.AWSLambdaInvokedARN(ctxFunctionArn))
MrAlias marked this conversation as resolved.
Show resolved Hide resolved
arnParts := strings.Split(ctxFunctionArn, ":")
if len(arnParts) >= 5 {
attributes = append(attributes, semconv.CloudAccountID(arnParts[4]))
Expand Down
Expand Up @@ -40,7 +40,7 @@ import (
"go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
"go.opentelemetry.io/otel/sdk/trace/tracetest"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down Expand Up @@ -136,8 +136,8 @@ var (
SpanKind: trace.SpanKindServer,
StartTime: time.Time{},
EndTime: time.Time{},
Attributes: []attribute.KeyValue{attribute.String("faas.execution", "123"),
attribute.String("faas.id", "arn:partition:service:region:account-id:resource-type:resource-id"),
Attributes: []attribute.KeyValue{attribute.String("faas.invocation_id", "123"),
attribute.String("aws.lambda.invoked_arn", "arn:partition:service:region:account-id:resource-type:resource-id"),
attribute.String("cloud.account.id", "account-id")},
Events: nil,
Links: nil,
Expand Down Expand Up @@ -326,8 +326,8 @@ var (
SpanKind: trace.SpanKindServer,
StartTime: time.Time{},
EndTime: time.Time{},
Attributes: []attribute.KeyValue{attribute.String("faas.execution", "123"),
attribute.String("faas.id", "arn:partition:service:region:account-id:resource-type:resource-id"),
Attributes: []attribute.KeyValue{attribute.String("faas.invocation_id", "123"),
attribute.String("aws.lambda.invoked_arn", "arn:partition:service:region:account-id:resource-type:resource-id"),
attribute.String("cloud.account.id", "account-id")},
Events: nil,
Links: nil,
Expand Down
Expand Up @@ -102,8 +102,8 @@ var (
Kind: v1trace.Span_SPAN_KIND_SERVER,
StartTimeUnixNano: 0,
EndTimeUnixNano: 0,
Attributes: []*v1common.KeyValue{{Key: "faas.execution", Value: &v1common.AnyValue{Value: &v1common.AnyValue_StringValue{StringValue: "123"}}},
{Key: "faas.id", Value: &v1common.AnyValue{Value: &v1common.AnyValue_StringValue{StringValue: "arn:partition:service:region:account-id:resource-type:resource-id"}}},
Attributes: []*v1common.KeyValue{{Key: "faas.invocation_id", Value: &v1common.AnyValue{Value: &v1common.AnyValue_StringValue{StringValue: "123"}}},
{Key: "aws.lambda.invoked_arn", Value: &v1common.AnyValue{Value: &v1common.AnyValue_StringValue{StringValue: "arn:partition:service:region:account-id:resource-type:resource-id"}}},
{Key: "cloud.account.id", Value: &v1common.AnyValue{Value: &v1common.AnyValue_StringValue{StringValue: "account-id"}}}},
DroppedAttributesCount: 0,
Events: nil,
Expand Down
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/aws/smithy-go/middleware"

"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

// AWS attributes.
Expand Down
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

func TestOperationAttr(t *testing.T) {
Expand Down
Expand Up @@ -26,7 +26,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
"go.opentelemetry.io/otel/trace"
)

Expand Down
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/aws/smithy-go/middleware"

"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

// DynamoDBAttributeSetter sets DynamoDB specific attributes depending on the DynamoDB operation being performed.
Expand Down
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/aws/smithy-go/middleware"

"go.opentelemetry.io/otel/attribute"
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

// SQSAttributeSetter sets SQS specific attributes depending on the SQS operation being performed.
Expand Down
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/aws/smithy-go/middleware"
"github.com/stretchr/testify/assert"

semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
)

func TestSQSDeleteMessageBatchInput(t *testing.T) {
Expand Down