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

Split out gRPC library instrumentation. #1329

Merged

Conversation

anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Oct 6, 2020

For #1313

@@ -77,8 +85,6 @@ class GrpcTest extends AgentTestRunner {
"${SemanticAttributes.RPC_SYSTEM.key()}" "grpc"
"${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key()}" "SayHello"
"${SemanticAttributes.NET_PEER_NAME.key()}" "localhost"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a regression, but I want to fix forward. Previously auto instrumentation got the address from the channel builder, but it seems weird to force that into library instrumentation too. gRPC does have a remote transport address attribute with some behavior difference between versions. Want to dig into that more as a followup instead of having to add address as a parameter to the interceptor's factories. How does that sound?

Copy link
Member

Choose a reason for hiding this comment

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

No objection from me, let's create a tracking issue for this if @iNikem does not object.

@asarkar
Copy link

asarkar commented Oct 6, 2020

@anuraaga The brave-grpc instrumentation crapped out for my simple use case. You might want to check if your impl works when the Context is modified using a ServerInterceptor.
spring-cloud/spring-cloud-sleuth#1749

…-instr-java into separate-grpc-instrumentation
@anuraaga
Copy link
Contributor Author

anuraaga commented Oct 6, 2020

@asarkar Thanks for the note, we'll definitely make sure that use case works well. I'm currently refactoring OTel's context propagation from the ground up and gRPC context interop is a main goal of the changes so hopefully it helps you too.

Comment on lines +32 to +35
implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'

implementation deps.guava

Copy link
Member

Choose a reason for hiding this comment

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

are these dependencies needed?

Suggested change
implementation group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
implementation deps.guava

}

dependencies {
compileOnly(project(':instrumentation:grpc-1.5:library'))
Copy link
Member

Choose a reason for hiding this comment

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

it's amazing to me that this does not create a cyclic dependency

the test that uses GrpcHelper does look a bit suspicious (using the same method to verify the status as was used to map the status), maybe better to add an extra spock data column to those test for otelStatus?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously I was avoiding having to duplicate the statuscode mapping in the logic, its unit test, and here too. Now it's always one status though so no reason to use the helper :)

@@ -77,8 +85,6 @@ class GrpcTest extends AgentTestRunner {
"${SemanticAttributes.RPC_SYSTEM.key()}" "grpc"
"${SemanticAttributes.RPC_SERVICE.key()}" "example.Greeter"
"${SemanticAttributes.RPC_METHOD.key()}" "SayHello"
"${SemanticAttributes.NET_PEER_NAME.key()}" "localhost"
Copy link
Member

Choose a reason for hiding this comment

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

No objection from me, let's create a tracking issue for this if @iNikem does not object.

Anuraag Agrawal added 2 commits October 7, 2020 13:02
@anuraaga anuraaga merged commit 525b3f7 into open-telemetry:master Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants