Skip to content

CAMEL-15339 Opentelemetry component#4016

Merged
oscerd merged 4 commits into
apache:masterfrom
rubenvp8510:opentelemetry
Jul 29, 2020
Merged

CAMEL-15339 Opentelemetry component#4016
oscerd merged 4 commits into
apache:masterfrom
rubenvp8510:opentelemetry

Conversation

@rubenvp8510
Copy link
Copy Markdown
Contributor

@rubenvp8510 rubenvp8510 commented Jul 18, 2020

The intention of this PR is to add opentelemetry support to camel,

This initial PR will do the same as camel-opentracing component, but will use opentelemetry to do it. I had to refactor camel-opentracing in order to reuse span decorators. In order to do that I created a new component camel-tracing which contains all common interfaces used by SpanDecorator, and a general Tracer abstract class . Both implementations opentracing and opentelemetry should extend Tracer and implement the abstract methods, they should also implement the SpanAdapter interface ,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.

@rubenvp8510 rubenvp8510 force-pushed the opentelemetry branch 3 times, most recently from 2e85ed4 to c225d92 Compare July 19, 2020 01:01
Copy link
Copy Markdown
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

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

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.

Comment thread components/camel-opentelemetry/pom.xml Outdated
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.28.0</version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you should use the version from parent POM

Comment thread components/camel-opentelemetry/pom.xml Outdated
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>0.6.0</version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It should be declared in the parent POM

*/
package org.apache.camel.opentelemetry;

import java.util.*;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please use the explicit imports, no * operator

@@ -24,6 +24,7 @@
import org.apache.camel.spi.IdAware;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will probably create conflicts with this #4001 once we merge it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see :( I'll fix those conflicts.

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.net.*;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please use the explicit imports.

@rubenvp8510
Copy link
Copy Markdown
Contributor Author

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.

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 mvn clean install -Psourcecheck locally and it passed. :/

@rubenvp8510 rubenvp8510 force-pushed the opentelemetry branch 9 times, most recently from 0860f26 to 17eee21 Compare July 25, 2020 00:35
Signed-off-by: Ruben <ruben.vp8510@gmail.com>
@rubenvp8510 rubenvp8510 force-pushed the opentelemetry branch 3 times, most recently from 1f04f1a to 6b4e2bc Compare July 25, 2020 04:37
Signed-off-by: Ruben <ruben.vp8510@gmail.com>
Signed-off-by: Ruben <ruben.vp8510@gmail.com>
@rubenvp8510 rubenvp8510 changed the title [WIP] opentelemetry support Opentelemetry support Jul 27, 2020
@rubenvp8510 rubenvp8510 changed the title Opentelemetry support [CAMEL-15339] Opentelemetry component Jul 27, 2020
@rubenvp8510 rubenvp8510 requested a review from oscerd July 27, 2020 16:20
@rubenvp8510 rubenvp8510 changed the title [CAMEL-15339] Opentelemetry component CAMEL-15339 Opentelemetry component Jul 28, 2020
Copy link
Copy Markdown
Contributor

@oscerd oscerd left a comment

Choose a reason for hiding this comment

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

LGTM, @davsclaus can you have a look?

Copy link
Copy Markdown
Contributor

@davsclaus davsclaus left a comment

Choose a reason for hiding this comment

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

Only a few comments that we can also fix in a 2nd PR

Comment thread components/camel-opentelemetry/pom.xml Outdated
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporters-inmemory</artifactId>
<version>0.6.0</version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use version placeholder


@Override public void log(Map<String, String> fields) {
span.addEvent(getEventNameFromFields(fields), convertToAttributes(fields));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove empty line


public class OpenTelemetryGetter implements HttpTextFormat.Getter<ExtractAdapter> {

@Nullable @Override public String get(ExtractAdapter adapter, String key) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We do not use Nullable annotations in camel (yet)

return false;
}

private final class TracingEventNotifier extends EventNotifierSupport {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the logging below change OpenTracing to Tracing

Signed-off-by: Ruben <ruben.vp8510@gmail.com>
@davsclaus
Copy link
Copy Markdown
Contributor

After this PR we should likely get camel-zipkin to use camel-tracing as well.
And then we need to update the camel karaf features also

@oscerd
Copy link
Copy Markdown
Contributor

oscerd commented Jul 29, 2020

I'm going to merge today. I'm not completely sure it will possible to do the job for Zipkin anyway.

@oscerd
Copy link
Copy Markdown
Contributor

oscerd commented Jul 29, 2020

I guess we'll have to regen also the spring-boot starters related to this.

@jam01
Copy link
Copy Markdown
Contributor

jam01 commented Jul 29, 2020

There are some changes from #4044 that'll have to reworked into the new tracing component, I believe.

@oscerd
Copy link
Copy Markdown
Contributor

oscerd commented Jul 29, 2020

@jam01 I do believe we need to merge this PR asap, so you'll be able to align, let me merge it.

@oscerd oscerd merged commit ff6d52b into apache:master Jul 29, 2020
@oscerd
Copy link
Copy Markdown
Contributor

oscerd commented Jul 29, 2020

Thanks for this @rubenvp8510

@oscerd
Copy link
Copy Markdown
Contributor

oscerd commented Jul 29, 2020

@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

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.

4 participants