Skip to content
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

Parallel SDK requests share the same OpenTelemetry span #1211

Open
1 task
SamWot opened this issue Jan 9, 2025 · 0 comments
Open
1 task

Parallel SDK requests share the same OpenTelemetry span #1211

SamWot opened this issue Jan 9, 2025 · 0 comments
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@SamWot
Copy link

SamWot commented Jan 9, 2025

Describe the bug

I'm using SDK in Ktor server to access Bedrock. Each user request to the server creates a new span (with a new traceId) and corresponds to 1 call to Bedrock.
I was trying to use OpenTelemetryProvider to add tracing for SDK. However, enabling telemetryProvider causes multiple independent user requests to share the same traceId (essentially breaking traces).

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected behavior

Each user request should use a different traceId

Current behavior

Multiple user requests share the same traceId

Steps to Reproduce

Perform 2 consecutive calls to Bedrock through SDK under independent OpenTelemetry spans

Possible Solution

From the first look, it seems like the line private val spanScope = otelSpan.makeCurrent() (here) might be the issue.

Context

No response

Smithy-Kotlin version

1.3.31

Platform (JVM/JS/Native)

JVM

Operating system and version

MacOS 15.1.1

@SamWot SamWot added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 9, 2025
@0marperez 0marperez added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants