diff --git a/contrib/aws/aws-sdk-go-v2/aws/eventbridge/eventbridge.go b/contrib/aws/aws-sdk-go-v2/aws/eventbridge/eventbridge.go index 572ec49eef..27c8866a60 100644 --- a/contrib/aws/aws-sdk-go-v2/aws/eventbridge/eventbridge.go +++ b/contrib/aws/aws-sdk-go-v2/aws/eventbridge/eventbridge.go @@ -24,6 +24,7 @@ const ( datadogKey = "_datadog" startTimeKey = "x-datadog-start-time" resourceNameKey = "x-datadog-resource-name" + maxSizeBytes = 256 * 1024 // 256 KB ) func init() { @@ -106,5 +107,11 @@ func injectTraceContext(ctx context.Context, entryPtr *types.PutEventsRequestEnt return } + // Check new detail size + if len(updatedDetail) > maxSizeBytes { + log.Info("Payload size too large to pass context") + return + } + entryPtr.Detail = aws.String(string(updatedDetail)) } diff --git a/contrib/aws/aws-sdk-go-v2/aws/sns/sns.go b/contrib/aws/aws-sdk-go-v2/aws/sns/sns.go index 923f2731ca..39fd81f871 100644 --- a/contrib/aws/aws-sdk-go-v2/aws/sns/sns.go +++ b/contrib/aws/aws-sdk-go-v2/aws/sns/sns.go @@ -84,7 +84,7 @@ func injectTraceContext(ctx context.Context, messageAttributes map[string]types. // https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html // Only inject if there's room. if len(messageAttributes) >= maxMessageAttributes { - log.Debug("Cannot inject trace context: message already has maximum allowed attributes") + log.Info("Cannot inject trace context: message already has maximum allowed attributes") return } diff --git a/contrib/aws/aws-sdk-go-v2/aws/sqs/sqs.go b/contrib/aws/aws-sdk-go-v2/aws/sqs/sqs.go index 0a5e83538c..e095af9c02 100644 --- a/contrib/aws/aws-sdk-go-v2/aws/sqs/sqs.go +++ b/contrib/aws/aws-sdk-go-v2/aws/sqs/sqs.go @@ -84,7 +84,7 @@ func injectTraceContext(ctx context.Context, messageAttributes map[string]types. // https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes // Only inject if there's room. if len(messageAttributes) >= maxMessageAttributes { - log.Debug("Cannot inject trace context: message already has maximum allowed attributes") + log.Info("Cannot inject trace context: message already has maximum allowed attributes") return }