Skip to content

Commit

Permalink
[#3190] Use OpenTelemetry for tracing (via OpenTracing shim).
Browse files Browse the repository at this point in the history
Signed-off-by: Carsten Lohmann <[email protected]>
  • Loading branch information
calohmn committed Apr 20, 2022
1 parent 9e32450 commit 0949107
Show file tree
Hide file tree
Showing 48 changed files with 691 additions and 694 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/native-images-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ jobs:
run: |
mvn install -B -e -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dquarkus.native.remote-container-build=false -Dquarkus.native.container-build=true \
-Pjaeger,build-native-image -am \
-Pbuild-native-image -am \
-pl :hono-service-auth-quarkus,:hono-service-command-router-quarkus,:hono-service-device-registry-mongodb-quarkus,\
:hono-adapter-mqtt-vertx-quarkus,:hono-adapter-amqp-vertx-quarkus,:hono-adapter-coap-vertx-quarkus,:hono-adapter-http-vertx-quarkus,\
:hono-tests
- name: "Build JDBC registry image"
run: |
mvn install -B -e -DskipTests -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Pjaeger,build-docker-image -am -pl :hono-service-device-registry-jdbc-quarkus
-Pbuild-docker-image -am -pl :hono-service-device-registry-jdbc-quarkus
- name: "Run integration tests with Mongo DB and Kafka"
run: |
mvn verify -pl :hono-tests -B -e -DCI=$CI \
Expand Down
47 changes: 0 additions & 47 deletions adapters/base-quarkus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>set-system-properties</goal>
</goals>
<configuration>
<properties>
<property>
<name>quarkus.jaeger.metrics.enabled</name>
<value>${jaeger.metrics.enabled}</value>
</property>
</properties>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -254,32 +234,5 @@
</dependency>
</dependencies>
</profile>

<profile>
<id>jaeger</id>
<activation>
<property>
<name>jaeger</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>io.jaegertracing</groupId>
<artifactId>jaeger-client</artifactId>
</dependency>
<dependency>
<groupId>io.jaegertracing</groupId>
<artifactId>jaeger-micrometer</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jaeger</artifactId>
</dependency>
<dependency>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
7 changes: 0 additions & 7 deletions adapters/coap-vertx-quarkus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@
<artifactId>vertx-core</artifactId>
</dependency>

<!-- testing -->
<dependency>
<groupId>io.jaegertracing</groupId>
<artifactId>jaeger-client</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2019, 2021 Contributors to the Eclipse Foundation
* Copyright (c) 2019, 2022 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
Expand All @@ -21,7 +21,6 @@

import org.eclipse.californium.core.CoapResource;
import org.eclipse.californium.core.coap.CoAP.ResponseCode;
import org.eclipse.californium.core.coap.OptionSet;
import org.eclipse.californium.core.coap.Response;
import org.eclipse.californium.core.network.Exchange;
import org.eclipse.californium.core.server.resources.CoapExchange;
Expand All @@ -36,9 +35,7 @@
import org.slf4j.LoggerFactory;

import io.opentracing.Span;
import io.opentracing.SpanContext;
import io.opentracing.Tracer;
import io.opentracing.propagation.Format;
import io.opentracing.tag.Tags;
import io.vertx.core.Future;
import io.vertx.core.Promise;
Expand Down Expand Up @@ -149,16 +146,10 @@ public static String getAuthId(final CoapExchange exchange) {
return extPrincipal.getExtendedInfo().get(DeviceInfoSupplier.EXT_INFO_KEY_HONO_AUTH_ID, String.class);
}

private SpanContext extractSpanContextFromRequest(final OptionSet requestOptions) {
return CoapOptionInjectExtractAdapter.forExtraction(requestOptions)
.map(carrier -> tracer.extract(Format.Builtin.BINARY, carrier))
.orElse(null);
}

private Span newSpan(final Exchange exchange) {
return TracingHelper.buildServerChildSpan(
tracer,
extractSpanContextFromRequest(exchange.getRequest().getOptions()),
null,
exchange.getRequest().getCode().toString(),
adapter.getTypeName())
.withTag(Tags.HTTP_METHOD, exchange.getRequest().getCode().name())
Expand All @@ -177,11 +168,6 @@ private Span newSpan(final Exchange exchange) {
* associated with the {@link CoapContext} that is created by the <em>createCoapContextForXXX</em>
* method matching the request code. The {@link CoapContext} is then passed in to the corresponding
* <em>handleXXXX</em> method.
* <p>
* If the request contains the {@link CoapOptionInjectExtractAdapter#OPTION_TRACE_CONTEXT} option, its value
* is expected to be a binary encoded trace context and the {@link CoapOptionInjectExtractAdapter}
* is used to extract a {@code SpanContext} which is then used as the parent of the newly created
* {@code Span}.
*/
@Override
public void handleRequest(final Exchange exchange) {
Expand Down

This file was deleted.

Loading

0 comments on commit 0949107

Please sign in to comment.