Open lgcmotta opened 1 year ago
We have noticed this also with presigning EKS tokens with otelaws v0.39.0
I also faced the same issue. I implemented noOpTextMapPropagator that does nothing because it is not necessary to include the traceparent header in AWS API requests, and used it in the config as a temporary workaround.
type noOpTextMapPropagator struct{}
func (n noOpTextMapPropagator) Inject(ctx context.Context, carrier propagation.TextMapCarrier) {}
func (n noOpTextMapPropagator) Extract(ctx context.Context, carrier propagation.TextMapCarrier) context.Context {
return ctx
}
func (n noOpTextMapPropagator) Fields() []string {
return []string{}
}
cfg, _ := config.LoadDefaultConfig(context.Background())
otelaws.AppendMiddlewares(
&cfg.APIOptions,
otelaws.WithTextMapPropagator(noOpTextMapPropagator{}),
)
I'm very happy to find this at the end of a long search :)
@kazz187 Thanks a lot for the workaround. I'd like to add that there is a noop propagator available out of the box (which I've found because it's the default in an unconfigured otel): propagation.NewCompositeTextMapPropagator()
We've just run into this issue too. Is there a known fix, or do we have to disable the text propagation still?
Description
When adding the
otelaws.AppendMiddlewares(&cfg.APIOptions)
, all pre-signed URLs for downloading S3 files start to break with codeSignatureDoesNotMatch
and the message:When removing
otelaws.AppendMiddlewares(&cfg.APIOptions)
they immediately return to work.I'm attaching an image from a diff window with the generated URLs. The only difference that is not related to the AWS account nor the link expiration time is the
X-Amz-SignedHeaders
. The URL generated from code with otelaws middlewares has two valueshost
andtraceparent
, while the one without otelaws middlewares has onlyhost
.Packages installed
Code
I created a simple project to demonstrate this behavior.
👉 Code is available here. 👈
This sample exports traces to Jaeger using OTLP with gRPC and
opentelemetry-collector-contrib
at version0.68.0
.This is the code with AWS SDK v2 configuration and
otelaws
middleware:Steps to reproduce:
~/.aws/credentials
fileBUCKET_NAME
with an existent AWS S3 Bucket name:Call the
/s3/files/{name}
endpoint with a valid S3 file within the your bucket.Try to download the file with the generated URL, this URL will work.
Call the
/s3/files/otel/{name}
endpoint with a valid S3 file within the your bucket.Try to download the file with the generated URL, this URL will not work.
Open Jaeger UI:
/s3/files/{name}
should have one span, while the trace for/s3/files/otel/{name}
should have two spans.