-
Notifications
You must be signed in to change notification settings - Fork 1k
Add common TextMapGetter test #15618
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
base: main
Are you sure you want to change the base?
Conversation
| * <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 |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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)
Closes #15521
Also uncovered a potential bug in the gRPC instrumentation