-
Notifications
You must be signed in to change notification settings - Fork 862
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
Implemented the Jaeger Span Exporter using gRPC as the transport #481
Implemented the Jaeger Span Exporter using gRPC as the transport #481
Conversation
Marking this as WIP while I run some manual tests against an actual Jaeger collector. |
8af872f
to
d8cda8d
Compare
This is how a span looks like on Jaeger, with a code similar to this: ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 14250).usePlaintext().build();
JaegerGrpcSpanExporter exporter = JaegerGrpcSpanExporter.newBuilder()
.setChannel(channel)
.setServiceName("instrumented-with-opentelemetry")
.setDeadline(0)
.build();
TracerSdk tracer = new TracerSdk();
tracer.addSpanProcessor(SimpleSampledSpansProcessor.newBuilder(exporter).build());
io.opentelemetry.trace.Span span = tracer.spanBuilder("my-operation").startSpan();
span.end(); |
8216f9e
to
8260ab5
Compare
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.
Initial set of comments.
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Outdated
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Outdated
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Outdated
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/JaegerGrpcSpanExporter.java
Outdated
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #481 +/- ##
===========================================
+ Coverage 77.96% 78.17% +0.2%
- Complexity 555 556 +1
===========================================
Files 67 67
Lines 1970 1970
Branches 186 186
===========================================
+ Hits 1536 1540 +4
+ Misses 372 367 -5
- Partials 62 63 +1
Continue to review full report at Codecov.
|
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.
PR updated. I set the items I fixed as "marked as resolved", but there are a couple of items still open. The most important is about looking into the status code from the collector and determining whether the call should be retried.
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Outdated
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/JaegerGrpcSpanExporter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/JaegerGrpcSpanExporter.java
Outdated
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/JaegerGrpcSpanExporter.java
Outdated
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/JaegerGrpcSpanExporter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/JaegerGrpcSpanExporter.java
Show resolved
Hide resolved
exporters/jaeger/src/main/java/io/opentelemetry/exporters/jaeger/JaegerGrpcSpanExporter.java
Show resolved
Hide resolved
Please rebase. |
@pavolloffay do you think going with submodules is the right thing to do? If so where are these protos? |
40d3978
to
59b85af
Compare
I think there are two viable solutions
If we build them here we control the protobuf compiler versions. However I am not sure if that is an issue or not, but otherwise maybe compiling them outside of this repo seems better to me. |
Submodule won't work just yet as we don't publish Jaeger proto to jaeger-idl (because of gogo annotations, jaegertracing/jaeger-idl#55). I do not recommend building classes in an outside repo either, because it creates a potential conflict of protobuf-related library versions. The IDLs are the official interface for interoperability. What is the concern of simply copying proto files? It's not much different from a submodule approach, you still need to manually pick newer versions. |
To not block this PR, I would suggest that we keep the copy for the moment of the proto, but I would suggest that we document in a README file in this modules where the protos are copied |
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
59b85af
to
64bea08
Compare
Done. |
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.
This looks good! I had some minor comments.
How do we feel about adding e2e tests? This could be easily done using docker via java-testcontainers https://github.com/testcontainers/testcontainers-java with jaeger all-in-one distribution. Here are some examples
- https://github.com/opentracing-contrib/java-spring-jaeger/blob/master/opentracing-spring-jaeger-web-starter-it/src/test/java/io/opentracing/contrib/java/spring/web/jaeger/starter/it/JaegerIntegrationTest.java#L49
- https://github.com/jaegertracing/spark-dependencies/blob/master/jaeger-spark-dependencies-elasticsearch/src/test/java/io/jaegertracing/spark/dependencies/elastic/JaegerElasticsearchEnvironment.java#L63
|
||
dependencies { | ||
api project(':opentelemetry-api') | ||
api project(':opentelemetry-sdk') |
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.
Should be SDK as provided 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.
Did you mean implementation
instead of provided
? I think it's appropriate to have api
here, as methods from this module accept and return instances of classes defined by the SDK module.
An API dependency is one that contains at least one type that is exposed in the library binary interface, often referred to as its ABI (Application Binary Interface).
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.
How is api
translated to maven dependency type? Is it compile
or provided
? I thought it is provided
.
Provided means that you need the JAR for compiling, but at run time there is already a JAR provided by the environment so you don't need it packaged with your app. For a web app, this means that the JAR file will not be placed into the WEB-INF/lib directory.
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.
The differences in Gradle are mostly about what is exported to consumers of the library: an application declaring a dependency on the exporters/jaeger
module will have opentelemetry-sdk
as a transitive dependency, as it's declared as api
. The dependencies that exporters/jaeger
declare as implementation
aren't transitive dependencies for a consumer.
There's a runtimeOnly
mode as well, which is probably close to what provided
does in Maven. But still, I don't think it's the right mode. api
still seems the most appropriate here.
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
I'm all for it, on a follow-up PR. |
@jpkrohling could you please open an issue so we can discuss it there? |
@jpkrohling please file the issue that @pavolloffay mentioned. |
Created #498 |
can you give me full example of this ..#481 (comment) |
It seems you have problem with TLS. You can check this example how to fully create a tracer which exports to Jaeger: https://github.com/dynatrace-oss-contrib/opentelemetry-java/tree/add-jaeger-example/examples/jaeger |
Closes #469 by implementing a Jaeger Span Exporter
Signed-off-by: Juraci Paixão Kröhling juraci@kroehling.de