-
Notifications
You must be signed in to change notification settings - Fork 771
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
fix grpc set metadata multi-value #11308
base: main
Are you sure you want to change the base?
Conversation
@wgy035 Please sign the CLA. |
...rpc-1.6/library/src/main/java/io/opentelemetry/instrumentation/grpc/v1_6/MetadataSetter.java
Outdated
Show resolved
Hide resolved
Got it. And now I'm trying to add a test. |
|
||
public class GrpcPropagator implements TextMapPropagator { | ||
|
||
public static final String FIELD = "X-grpc-field"; |
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.
public static final String FIELD = "X-grpc-field"; | |
private static final String FIELD = "X-grpc-field"; |
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.
done
|
||
@Override | ||
public List<String> fields() { | ||
return Collections.singletonList(FIELD); |
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.
Suggest to use static import here, for more style guidance you can refer to
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/contributing/style-guideline.md#static-imports
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.
helpful suggestions
|
||
@Test | ||
void checkThatIterableSizeEqualsOne() { | ||
GrpcPropagator tested = new GrpcPropagator(); |
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.
I would define a more meaningful name here, if it's hard to do here, is the propagator
a better choice than now?
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.
I've already change the name
Improve grpc metadata overwrite test
Resolves #11237
removeAll
key beforeput
in grpcMetadataSetter