Skip to content

Commit

Permalink
Merge branch 'main' into deprecate-modules-without-codeowners
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Sep 6, 2023
2 parents 3dee7b5 + 417fc12 commit 2b0c613
Show file tree
Hide file tree
Showing 21 changed files with 48 additions and 33 deletions.
15 changes: 15 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 All @@ -27,6 +38,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Change interceptors in `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` to disable `SENT`/`RECEIVED` events.
Use `WithMessageEvents()` to turn back on. (#3964)

### Changed

- `go.opentelemetry.io/contrib/detectors/gcp`: Detect `faas.instance` instead of `faas.id`, since `faas.id` is being removed. (#4198)

### Fixed

- AWS XRay Remote Sampling to cap `quotaBalance` to 1x quota in `go.opentelemetry.io/contrib/samplers/aws/xray`. (#3651, #3652)
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
8 changes: 4 additions & 4 deletions detectors/gcp/detector.go
Expand Up @@ -60,27 +60,27 @@ func (d *detector) Detect(ctx context.Context) (*resource.Resource, error) {
b.attrs = append(b.attrs, semconv.CloudPlatformGCPCloudRun)
b.add(semconv.FaaSNameKey, d.detector.FaaSName)
b.add(semconv.FaaSVersionKey, d.detector.FaaSVersion)
b.add(semconv.FaaSIDKey, d.detector.FaaSID)
b.add(semconv.FaaSInstanceKey, d.detector.FaaSID)
b.add(semconv.CloudRegionKey, d.detector.FaaSCloudRegion)
case gcp.CloudFunctions:
b.attrs = append(b.attrs, semconv.CloudPlatformGCPCloudFunctions)
b.add(semconv.FaaSNameKey, d.detector.FaaSName)
b.add(semconv.FaaSVersionKey, d.detector.FaaSVersion)
b.add(semconv.FaaSIDKey, d.detector.FaaSID)
b.add(semconv.FaaSInstanceKey, d.detector.FaaSID)
b.add(semconv.CloudRegionKey, d.detector.FaaSCloudRegion)
case gcp.AppEngineFlex:
b.attrs = append(b.attrs, semconv.CloudPlatformGCPAppEngine)
b.addZoneAndRegion(d.detector.AppEngineFlexAvailabilityZoneAndRegion)
b.add(semconv.FaaSNameKey, d.detector.AppEngineServiceName)
b.add(semconv.FaaSVersionKey, d.detector.AppEngineServiceVersion)
b.add(semconv.FaaSIDKey, d.detector.AppEngineServiceInstance)
b.add(semconv.FaaSInstanceKey, d.detector.AppEngineServiceInstance)
case gcp.AppEngineStandard:
b.attrs = append(b.attrs, semconv.CloudPlatformGCPAppEngine)
b.add(semconv.CloudAvailabilityZoneKey, d.detector.AppEngineStandardAvailabilityZone)
b.add(semconv.CloudRegionKey, d.detector.AppEngineStandardCloudRegion)
b.add(semconv.FaaSNameKey, d.detector.AppEngineServiceName)
b.add(semconv.FaaSVersionKey, d.detector.AppEngineServiceVersion)
b.add(semconv.FaaSIDKey, d.detector.AppEngineServiceInstance)
b.add(semconv.FaaSInstanceKey, d.detector.AppEngineServiceInstance)
case gcp.GCE:
b.attrs = append(b.attrs, semconv.CloudPlatformGCPComputeEngine)
b.addZoneAndRegion(d.detector.GCEAvailabilityZoneAndRegion)
Expand Down
8 changes: 4 additions & 4 deletions detectors/gcp/detector_test.go
Expand Up @@ -113,7 +113,7 @@ func TestDetect(t *testing.T) {
semconv.CloudRegion("us-central1"),
semconv.FaaSName("my-service"),
semconv.FaaSVersion("123456"),
semconv.FaaSID("1472385723456792345"),
semconv.FaaSInstance("1472385723456792345"),
),
},
{
Expand All @@ -133,7 +133,7 @@ func TestDetect(t *testing.T) {
semconv.CloudRegion("us-central1"),
semconv.FaaSName("my-service"),
semconv.FaaSVersion("123456"),
semconv.FaaSID("1472385723456792345"),
semconv.FaaSInstance("1472385723456792345"),
),
},
{
Expand All @@ -155,7 +155,7 @@ func TestDetect(t *testing.T) {
semconv.CloudAvailabilityZone("us-central1-c"),
semconv.FaaSName("my-service"),
semconv.FaaSVersion("123456"),
semconv.FaaSID("1472385723456792345"),
semconv.FaaSInstance("1472385723456792345"),
),
},
{
Expand All @@ -177,7 +177,7 @@ func TestDetect(t *testing.T) {
semconv.CloudAvailabilityZone("us-central1-c"),
semconv.FaaSName("my-service"),
semconv.FaaSVersion("123456"),
semconv.FaaSID("1472385723456792345"),
semconv.FaaSInstance("1472385723456792345"),
),
},
{
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))
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

0 comments on commit 2b0c613

Please sign in to comment.