Skip to content

Conversation

@jaydeluca
Copy link
Member

@jaydeluca jaydeluca commented Dec 12, 2025

Closes #15521

Also uncovered a potential bug in the gRPC instrumentation

@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Dec 12, 2025
* <p>This propagator wraps another propagator and calls methods during extraction. This catches
* compatibility issues where underlying library APIs change (e.g., NoSuchMethodError).
*
* <p>Note: This is a copy of the class in testing-common to avoid dependency conflicts
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I tried adding test-common as a dependency, I hit a bunch of ASM errors. I was able to get it to work by adding some dependency exclusions, but this seemed simpler. I can go back to the other approach if that is preferable

// accessed via Metadata.Key.of() and would cause IllegalArgumentException
return request.getMetadata().keys().stream()
.filter(key -> !key.startsWith(":"))
.collect(Collectors.toList());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes:

09:21:45.711 [armeria-common-worker-nio-2-2] WARN c.l.a.server.grpc.FramedGrpcService - Exception thrown from streaming request stub method before processing any request data - this is likely a bug in the stub implementation.
java.lang.IllegalArgumentException: Invalid character ':' in key name ':method'
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:273)
at io.grpc.Metadata$Key.validateName(Metadata.java:754)
at io.grpc.Metadata$Key.(Metadata.java:762)
at io.grpc.Metadata$Key.(Metadata.java:671)
at io.grpc.Metadata$AsciiKey.(Metadata.java:971)
at io.grpc.Metadata$AsciiKey.(Metadata.java:966)
at io.grpc.Metadata$Key.of(Metadata.java:708)
at io.grpc.Metadata$Key.of(Metadata.java:704)
at io.opentelemetry.javaagent.shaded.instrumentation.grpc.v1_6.GrpcRequestGetter.get(GrpcRequestGetter.java:29)
at io.opentelemetry.javaagent.shaded.instrumentation.grpc.v1_6.GrpcRequestGetter.get(GrpcRequestGetter.java:15)
at io.opentelemetry.javaagent.testing.util.KeysVerifyingPropagator.lambda$extract$0(KeysVerifyingPropagator.java:45)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)

@jaydeluca jaydeluca marked this pull request as ready for review December 12, 2025 15:21
@jaydeluca jaydeluca requested a review from a team as a code owner December 12, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test native This label can be applied to PRs to trigger them to run native tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add coverage of keys() to common test frameworks

1 participant