Tracer Version(s)
4.12.1, installed through Datadog Single Step Instrumentation
Python Version(s)
Python 3.14.6
Pip Version(s)
Not applicable. The application environment is managed with uv, and ddtrace is injected by Datadog Single Step Instrumentation under /opt/datadog/apm/library/python/.
Bug Report
After pods started receiving ddtrace 4.12.1 through Single Step Instrumentation, boto3 S3 requests made from an instrumented FastAPI request began failing AWS SigV4 authentication.
Observed failures:
HeadObject: HTTP 403 Forbidden
CopyObject: SignatureDoesNotMatch with The request signature we calculated does not match the signature you provided. Check your key and signing method.
The application uses normal boto3 APIs with a standard SigV4 S3 client. AWS authentication is provided by EKS Pod Identity. The IAM role, bucket access, region, and object existence were verified.
The same HeadObject request succeeds from a fresh Python process in the same Kubernetes pod, using the same Pod Identity, bucket, key, region, boto3 version, and botocore client configuration.
The problem was reproduced across multiple Kubernetes environments and newly created pods. Disabling the botocore integration resolves it. More specifically, setting DD_BOTOCORE_DISTRIBUTED_TRACING=false resolves the failure while allowing botocore instrumentation to remain enabled.
This appears related to the ddtrace 4.12.0 change that injects W3C/Datadog propagation headers into signed HTTP requests for all AWS services. The 4.12.0 release notes mention a fix for strict-signature endpoints, but S3 HeadObject and CopyObject still fail in this configuration on 4.12.1.
No account IDs, bucket names, object keys, credentials, session tokens, or customer data are included in this report.
Reproduction Code
import boto3
from botocore.config import Config
from ddtrace import tracer
client = boto3.client(
"s3",
config=Config(
signature_version="s3v4",
s3={
"addressing_style": "virtual",
"us_east_1_regional_endpoint": "regional",
},
),
)
with tracer.trace("s3-reproducer"):
client.head_object(
Bucket="example-private-bucket",
Key="example/object.pdf",
)
The production application triggers the call inside an inbound distributed FastAPI trace. With the default botocore distributed-tracing setting, S3 rejects the request. With the following setting, it succeeds:
DD_BOTOCORE_DISTRIBUTED_TRACING=false
The application flow also uses:
client.copy_object(
CopySource={
"Bucket": "example-private-source-bucket",
"Key": "example/object.pdf",
},
Bucket="example-private-destination-bucket",
Key="example/copied-object.pdf",
MetadataDirective="COPY",
)
For CopyObject, S3 returns the more explicit SignatureDoesNotMatch response.
Error Logs
ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden
ClientError: An error occurred (SignatureDoesNotMatch) when calling the CopyObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.
The application stack includes:
ddtrace/contrib/internal/botocore/patch.py
botocore/client.py
Libraries in Use
ddtrace==4.12.1
boto3==1.43.2
botocore==1.43.2
Python==3.14.6
FastAPI
Starlette
Datadog library injection path indicates Linux manylinux2014 aarch64.
Operating System
Linux, manylinux2014, aarch64, running in Kubernetes on AWS EKS with EKS Pod Identity.
Tracer Version(s)
4.12.1, installed through Datadog Single Step Instrumentation
Python Version(s)
Python 3.14.6
Pip Version(s)
Not applicable. The application environment is managed with uv, and ddtrace is injected by Datadog Single Step Instrumentation under
/opt/datadog/apm/library/python/.Bug Report
After pods started receiving ddtrace 4.12.1 through Single Step Instrumentation, boto3 S3 requests made from an instrumented FastAPI request began failing AWS SigV4 authentication.
Observed failures:
HeadObject: HTTP 403ForbiddenCopyObject:SignatureDoesNotMatchwithThe request signature we calculated does not match the signature you provided. Check your key and signing method.The application uses normal boto3 APIs with a standard SigV4 S3 client. AWS authentication is provided by EKS Pod Identity. The IAM role, bucket access, region, and object existence were verified.
The same
HeadObjectrequest succeeds from a fresh Python process in the same Kubernetes pod, using the same Pod Identity, bucket, key, region, boto3 version, and botocore client configuration.The problem was reproduced across multiple Kubernetes environments and newly created pods. Disabling the botocore integration resolves it. More specifically, setting
DD_BOTOCORE_DISTRIBUTED_TRACING=falseresolves the failure while allowing botocore instrumentation to remain enabled.This appears related to the ddtrace 4.12.0 change that injects W3C/Datadog propagation headers into signed HTTP requests for all AWS services. The 4.12.0 release notes mention a fix for strict-signature endpoints, but S3
HeadObjectandCopyObjectstill fail in this configuration on 4.12.1.No account IDs, bucket names, object keys, credentials, session tokens, or customer data are included in this report.
Reproduction Code
The production application triggers the call inside an inbound distributed FastAPI trace. With the default botocore distributed-tracing setting, S3 rejects the request. With the following setting, it succeeds:
The application flow also uses:
For
CopyObject, S3 returns the more explicitSignatureDoesNotMatchresponse.Error Logs
The application stack includes:
Libraries in Use
Datadog library injection path indicates Linux manylinux2014 aarch64.
Operating System
Linux, manylinux2014, aarch64, running in Kubernetes on AWS EKS with EKS Pod Identity.