-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spans are lost if the same client is used for multiple requests concurrently #145
Comments
Hi @snake-scaly, thank you for reporting this issue. Your contribution will be always welcomed and we are happy to help review pull request. |
snake-scaly
added a commit
to snake-scaly/aws-otel-dotnet-instrumentation
that referenced
this issue
Dec 10, 2024
snake-scaly
added a commit
to snake-scaly/aws-otel-dotnet-instrumentation
that referenced
this issue
Dec 11, 2024
snake-scaly
added a commit
to snake-scaly/aws-otel-dotnet-instrumentation
that referenced
this issue
Dec 18, 2024
snake-scaly
added a commit
to snake-scaly/aws-otel-dotnet-instrumentation
that referenced
this issue
Dec 19, 2024
snake-scaly
added a commit
to snake-scaly/aws-otel-dotnet-instrumentation
that referenced
this issue
Dec 20, 2024
snake-scaly
added a commit
to snake-scaly/aws-otel-dotnet-instrumentation
that referenced
this issue
Dec 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We've noticed recently in a high-load project I'm involved in that not all DynamoDB spans are reaching our APM. I have traced this issue down to the Activity field in the
AWSTracingPipelineHandler
.When the same
AmazonDynamoDBClient
is used concurrently to perform multiple async requests to Dynamo, this field gets overwritten by the most recent request. The Activities for the earlier requests become orphaned. The orphaned activities are never stopped and therefore never reach the collector. We confirmed that the same thing happens with concurrent requests toAmazonSQSClient
, and I'm pretty sure to any other client with a RuntimePipeline. Note that AWS clients are designed to be able to handle concurrent requests, and work as expected without the OpenTelemetry instrumentation.The fix is to make the Activity field AsyncLocal. I did test this fix by including the latest Main of this repository into our project instead of the NuGet package and fixing it locally. I can confirm that it solves the problem of disappearing spans.
Below is a patch with my fix. I can create a pull request if you prefer it that way.
The text was updated successfully, but these errors were encountered: