CAMEL-15339 Opentelemetry component#4016
Conversation
2e85ed4 to
c225d92
Compare
oscerd
left a comment
There was a problem hiding this comment.
Please run with the sourcecheck profile enabled because the indentation in parent pom seems to be wrong and in the components you'll get a bunch of errors to fix in terms of codestyle.
Also, what is the purpose of this PR? I see a camel-tracing component introduced. This seems to be a big change and refactoring so it probably deserve a JIRA issue with some explanation of what is the plan and what will be in the common module and what not.
Thanks.
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-netty-shaded</artifactId> | ||
| <version>1.28.0</version> |
There was a problem hiding this comment.
you should use the version from parent POM
| <dependency> | ||
| <groupId>io.opentelemetry</groupId> | ||
| <artifactId>opentelemetry-sdk</artifactId> | ||
| <version>0.6.0</version> |
There was a problem hiding this comment.
It should be declared in the parent POM
| */ | ||
| package org.apache.camel.opentelemetry; | ||
|
|
||
| import java.util.*; |
There was a problem hiding this comment.
Please use the explicit imports, no * operator
| @@ -24,6 +24,7 @@ | |||
| import org.apache.camel.spi.IdAware; | |||
There was a problem hiding this comment.
This will probably create conflicts with this #4001 once we merge it
There was a problem hiding this comment.
I see :( I'll fix those conflicts.
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Set; | ||
| import java.net.*; |
There was a problem hiding this comment.
Please use the explicit imports.
Hi, Thanks for the review, the purpose is to support opentelemetry, doing the same as opentracing does but using opentelemetry instead. The purpose of the refactorization is for reuse the span decorators. I'll check the code style, but I ran the |
0860f26 to
17eee21
Compare
Signed-off-by: Ruben <ruben.vp8510@gmail.com>
1f04f1a to
6b4e2bc
Compare
Signed-off-by: Ruben <ruben.vp8510@gmail.com>
6b4e2bc to
ac74e28
Compare
Signed-off-by: Ruben <ruben.vp8510@gmail.com>
ac74e28 to
3bae005
Compare
oscerd
left a comment
There was a problem hiding this comment.
LGTM, @davsclaus can you have a look?
davsclaus
left a comment
There was a problem hiding this comment.
Only a few comments that we can also fix in a 2nd PR
| <dependency> | ||
| <groupId>io.opentelemetry</groupId> | ||
| <artifactId>opentelemetry-exporters-inmemory</artifactId> | ||
| <version>0.6.0</version> |
|
|
||
| @Override public void log(Map<String, String> fields) { | ||
| span.addEvent(getEventNameFromFields(fields), convertToAttributes(fields)); | ||
|
|
|
|
||
| public class OpenTelemetryGetter implements HttpTextFormat.Getter<ExtractAdapter> { | ||
|
|
||
| @Nullable @Override public String get(ExtractAdapter adapter, String key) { |
There was a problem hiding this comment.
We do not use Nullable annotations in camel (yet)
| return false; | ||
| } | ||
|
|
||
| private final class TracingEventNotifier extends EventNotifierSupport { |
There was a problem hiding this comment.
In the logging below change OpenTracing to Tracing
Signed-off-by: Ruben <ruben.vp8510@gmail.com>
|
After this PR we should likely get camel-zipkin to use camel-tracing as well. |
|
I'm going to merge today. I'm not completely sure it will possible to do the job for Zipkin anyway. |
|
I guess we'll have to regen also the spring-boot starters related to this. |
|
There are some changes from #4044 that'll have to reworked into the new tracing component, I believe. |
|
@jam01 I do believe we need to merge this PR asap, so you'll be able to align, let me merge it. |
|
Thanks for this @rubenvp8510 |
|
@jam01 this has been merged, I'll go ahead with Karaf stuff and Spring Boot, but you can already had your PR to camel-tracing |
The intention of this PR is to add opentelemetry support to camel,
This initial PR will do the same as
camel-opentracingcomponent, but will use opentelemetry to do it. I had to refactorcamel-opentracing in order to reuse span decorators. In order to do that I created a new componentcamel-tracingwhich contains all common interfaces used bySpanDecorator, and a generalTracerabstract class . Both implementationsopentracingandopentelemetryshould extend Tracer and implement the abstract methods, they should also implement theSpanAdapterinterface ,the interface used by the decorators to add tags, labels etc.. to the Span.Not sure if this is the right approach If someone could give me more feedback on this will be appreciated. I would like o hear more options.