-
Notifications
You must be signed in to change notification settings - Fork 784
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
First attempt to add GRPC instrumentation #1139
Conversation
@tkvangorder Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@tkvangorder Thank you for signing the Contributor License Agreement! |
@marcingrzejszczak Here is the first stab at GRPC support. Things that make this strange:
|
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.
Most of this code is sample related and I'd suggest making a branch similar to dubbo example here instead. that leaves the code in this project concise to the point of sleuth, not the full operations of more demos.
https://github.com/openzipkin/sleuth-webmvc-example
spring-cloud-sleuth-core/pom.xml
Outdated
@@ -32,6 +32,11 @@ | |||
</parent> | |||
|
|||
<dependencies> | |||
<dependency> |
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 don't think this can be a mandatory dependency.
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.
yeah, after thinking about this, I can make this a test scope dependency, as it is during the tests that the failures manifest. Still not a great solution, but I am not sure what else would make more sense?
|
||
## Running with Zipkin: | ||
|
||
1. For conveinence, there is a docker-compose file in the project that can be used to launch zipkin locally. Otherwise, you will need to run zipkin separately. |
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.
Typo
1. For conveinence, there is a docker-compose file in the project that can be used to launch zipkin locally. Otherwise, you will need to run zipkin separately. | |
1. For convenience, there is a docker-compose file in the project that can be used to launch zipkin locally. Otherwise, you will need to run zipkin separately. |
version: '2' | ||
|
||
services: | ||
storage: |
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.
mysql is unnecessary for this.. just use default in-mem.. probably docker-compose itself is overkill
See also https://github.com/openzipkin/sleuth-webmvc-example
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 will clean that up as well, thanks.
@adriancole Thanks for the quick turn-around, I will move the sample out of the core project. Calling it a night, I will get this done tomorrow. |
yeah, after thinking about this, I can make this a test scope dependency,
as it is during the tests that the failures manifest. Still not a great
solution, but I am not sure what else would make more sense?
I agree it is a problem with grpc as it strictly depends on guava. You can
try dependencyManagement section to fix the version, but in practice sleuth
or boot bom will set the dependency versions. optional or provided scope I
think can also help make the build work but not interfere with versions
used by apps.
|
Codecov Report
@@ Coverage Diff @@
## master #1139 +/- ##
============================================
+ Coverage 69.34% 69.69% +0.34%
- Complexity 709 723 +14
============================================
Files 129 132 +3
Lines 3321 3349 +28
Branches 360 363 +3
============================================
+ Hits 2303 2334 +31
+ Misses 816 809 -7
- Partials 202 206 +4
Continue to review full report at Codecov.
|
|
@adriancole @marcingrzejszczak I did a little refactoring and added some documentation around the implementation details. How do you both feel about the dependency on grpc-spring-boot-starter? This can work for now but it feels like it would be better if there were a spring-sanctioned gRPC project: spring-grpc or spring-cloud-grpc? |
A gRPC sanctioned Spring-Boot starter would also be awesome: https://github.com/grpc-ecosystem could be a good home. I know there are other starters hanging around so it would be good to have a community maintained one that gRPC is willing to put their name on |
I think after Google open sourced gRPC they handed things over to the community, so I am not sure if it makes sense to put it under the GCP umbrella? I am a relative newbie to gRPC, so take my opinion with a grain of salt. Regardless of home, having an agreed upon home for Spring + gRPC would be great. In addition to https://github.com/LogNet/grpc-spring-boot-starter, there is also an interesting reactive effort https://github.com/salesforce/reactive-grpc |
From what I recall, the boot team prefers the starter to be external until there is some Framework integration (which there isn't, but there is a jira issue). |
I'm merging what we have here ATM and we can think of changing the starter to sth else if necessary. |
Another repo has done this. |
@yishibai02 This PR relies on grpc-spring-boot-starter being on the classpath and will add tracing interceptors to the servers (by introducing a brave's server tracing interceptor) and to clients (by introducing a spring-aware ManagedChannelBuilder and brave's client tracing interceptor) |
I see this repo also supports Spring Sleuth to trace application. I think these commit be better placed in the third-party starter repo. |
@yishibai02. Thanks for the clarification! The repo's have the same name but are very different in the implementation details. For now, this PR introduces auto-configuration only when the LogNet/grpc-spring-boot-starter is on the classpath. There is still work to be done to introduce an "official" project for using grpc with spring/spring boot. Perhaps yidongnan/grpc-spring-boot-starter might be a good place to start as a contribution towards that goal? |
No description provided.