You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Trace ids are not getting cleared between requests, when aws sdk v2 presign url was used during serving the request.
Steps to reproduce
We've got a spring boot application, deployed on AWS, with instrumentation agent from AWS OTEL ( + xray tracing)
Some of the app endpoints are responsible for creating presign urls to s3.
Threads that are serving those requests are getting stuck with the same trace id for the rest of the application lifetime.
Serving consecutive requests on those threads yields logs from OTEL debug:
[otel.javaagent 2023-08-17 08:31:07:036 +0000] [main/http-nio-53] WARN io.opentelemetry.javaagent.shaded.instrumentation.api.internal.ContextPropagationDebug - Unexpected non-root current context found when extracting remote context!
We're using software.amazon.awssdk.services.s3.internal.signing.DefaultS3Presigner (from SDK v2) to presign our requests.
I stumbled upon this PR #8815 which presumably explains what is the problem, and fixes it for sdk v1, so I replaced our usage of sdk v2 presigner with the presigning method mentioned in the PR and all the warning disappeared.
What did you expect to see?
New trace ids provided by API GW should not be ignored, new traces should be created and propagated. What did you see instead?
New traces provided by API GW are getting ignored, trace from requests creating presign urls are getting stuck on the threads (which is visible in MDC logs)
@laurit https://github.com/zbytt/otel-s3-presigner-bug contain minimal app that allows to reproduce the bug.
README.md file contain the instructions on how to reproduce it.
Running the app with profile 'bug' uses aws sdk v2 presigner which leads to erroneous handling of the request, running the same app without any profiles uses aws sdk v1 presigner in which case the error does not occur.
Provided requests need to be executed in order to show the problem.
Describe the bug
Trace ids are not getting cleared between requests, when aws sdk v2 presign url was used during serving the request.
Steps to reproduce
We've got a spring boot application, deployed on AWS, with instrumentation agent from AWS OTEL ( + xray tracing)
Some of the app endpoints are responsible for creating presign urls to s3.
Threads that are serving those requests are getting stuck with the same trace id for the rest of the application lifetime.
Serving consecutive requests on those threads yields logs from OTEL debug:
or
We're using software.amazon.awssdk.services.s3.internal.signing.DefaultS3Presigner (from SDK v2) to presign our requests.
I stumbled upon this PR #8815 which presumably explains what is the problem, and fixes it for sdk v1, so I replaced our usage of sdk v2 presigner with the presigning method mentioned in the PR and all the warning disappeared.
What did you expect to see?
New trace ids provided by API GW should not be ignored, new traces should be created and propagated.
What did you see instead?
New traces provided by API GW are getting ignored, trace from requests creating presign urls are getting stuck on the threads (which is visible in MDC logs)
What version are you using?
https://github.com/aws-observability/aws-otel-java-instrumentation/releases/tag/v1.28.0
Environment
Compiler: openjdk 17.0.7 2023-04-18
OS: Ubuntu 20.04
The text was updated successfully, but these errors were encountered: