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

In io.opentelemetry.instrumentation.grpc.v1_6 the Setter duplicates instead of replacing #11237

Open
cleverchuk opened this issue Apr 26, 2024 · 3 comments · May be fixed by #11308
Open

In io.opentelemetry.instrumentation.grpc.v1_6 the Setter duplicates instead of replacing #11237

cleverchuk opened this issue Apr 26, 2024 · 3 comments · May be fixed by #11308
Assignees
Labels
bug Something isn't working

Comments

@cleverchuk
Copy link
Contributor

Describe the bug

In this code block the carrier happens to be implemented as a multi-value map. This makes adding the same key with new value a none replacing operation. This behavior will cause the metadata transported across multiple services to keep growing as they update the traceparent or tracestate or any key.

Steps to reproduce

Setup three grpc service that communicate in linear fashion i.e A -> B -> C each instrumented with the agent. Log the carrier to console.

Expected behavior

For example if the agent is updating tracestate with the name of the service then the metadata log line in each service should like
A: [tracestate=name=A]
B: [tracestate=name=B]
C: [tracestate=name=C]

Actual behavior

A: [tracestate=name=A]
B: [tracestate=name=B, tracestate=name=A]
C: [tracestate=name=C, tracestate=name=B, tracestate=name=A]

Javaagent or library instrumentation version

v2.3.0

Environment

JDK: openjdk:17
OS: MacOS 14.4.1

Additional context

No response

@cleverchuk cleverchuk added bug Something isn't working needs triage New issue that requires triage labels Apr 26, 2024
@wgy035
Copy link

wgy035 commented May 8, 2024

Lifecycle of Metadata is a single RPC call. Maybe the better behavior is removeAll the key before adding new value.

@steverao steverao removed the needs triage New issue that requires triage label May 10, 2024
@steverao
Copy link
Contributor

I saw you created relevant PR. So I assigned this to you now. @wgy035

@laurit
Copy link
Contributor

laurit commented May 17, 2024

@cleverchuk would it be possible to provide a sample application that reproduces the issue. We need to build a test for this before #11308 can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants