-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add OpenTelemetry and Jaeger Exporter extensions with native support
- Loading branch information
1 parent
eefca21
commit 3c4a08f
Showing
57 changed files
with
2,282 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
extensions/opentelemetry-exporter-jaeger/deployment/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-opentelemetry-exporter-jaeger-parent</artifactId> | ||
<version>999-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>quarkus-opentelemetry-exporter-jaeger-deployment</artifactId> | ||
<name>Quarkus - OpenTelemetry Exporter - Jaeger - Deployment</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-opentelemetry-exporter-jaeger</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-opentelemetry-deployment</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-grpc-common-deployment</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5-internal</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.awaitility</groupId> | ||
<artifactId>awaitility</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-extension-processor</artifactId> | ||
<version>${project.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
40 changes: 40 additions & 0 deletions
40
...yment/src/main/java/io/quarkus/opentelemetry/exporter/jaeger/JaegerExporterProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.quarkus.opentelemetry.exporter.jaeger; | ||
|
||
import java.util.function.BooleanSupplier; | ||
|
||
import io.quarkus.arc.deployment.AdditionalBeanBuildItem; | ||
import io.quarkus.deployment.Feature; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.annotations.ExecutionTime; | ||
import io.quarkus.deployment.annotations.Record; | ||
import io.quarkus.deployment.builditem.FeatureBuildItem; | ||
|
||
public class JaegerExporterProcessor { | ||
|
||
static class JaegerExporterEnabled implements BooleanSupplier { | ||
JaegerExporterConfig.JaegerExporterBuildConfig jaegerExporterConfig; | ||
|
||
public boolean getAsBoolean() { | ||
return jaegerExporterConfig.enabled; | ||
} | ||
} | ||
|
||
@BuildStep(onlyIf = JaegerExporterEnabled.class) | ||
FeatureBuildItem feature() { | ||
return new FeatureBuildItem(Feature.OPENTELEMETRY_JAEGER_EXPORTER); | ||
} | ||
|
||
@BuildStep(onlyIf = JaegerExporterEnabled.class) | ||
AdditionalBeanBuildItem createBatchSpanProcessor() { | ||
return AdditionalBeanBuildItem.builder() | ||
.addBeanClass(JaegerExporterProvider.class) | ||
.setUnremovable().build(); | ||
} | ||
|
||
@BuildStep(onlyIf = JaegerExporterEnabled.class) | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
void installBatchSpanProcessorForJaeger(JaegerRecorder recorder, | ||
JaegerExporterConfig.JaegerExporterRuntimeConfig runtimeConfig) { | ||
recorder.installBatchSpanProcessorForJaeger(runtimeConfig); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...src/test/java/io/quarkus/opentelemetry/exporter/jaeger/JaegerExporterBadEndpointTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.quarkus.opentelemetry.exporter.jaeger; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.opentelemetry.api.OpenTelemetry; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class JaegerExporterBadEndpointTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)) | ||
.overrideConfigKey("quarkus.opentelemetry.tracer.exporter.jaeger.endpoint", "httz://nada:zero") | ||
.setExpectedException(IllegalStateException.class); | ||
|
||
@Inject | ||
OpenTelemetry openTelemetry; | ||
|
||
@Test | ||
void failStart() { | ||
Assertions.fail("Test should not be run as deployment should fail"); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...nt/src/test/java/io/quarkus/opentelemetry/exporter/jaeger/JaegerExporterDisabledTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.quarkus.opentelemetry.exporter.jaeger; | ||
|
||
import javax.enterprise.inject.Instance; | ||
import javax.inject.Inject; | ||
|
||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.opentelemetry.api.OpenTelemetry; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class JaegerExporterDisabledTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)) | ||
.overrideConfigKey("quarkus.opentelemetry.tracer.exporter.jaeger.enabled", "false"); | ||
|
||
@Inject | ||
OpenTelemetry openTelemetry; | ||
|
||
@Inject | ||
Instance<LateBoundBatchSpanProcessor> lateBoundBatchSpanProcessorInstance; | ||
|
||
@Test | ||
void testOpenTelemetryButNoBatchSpanProcessor() { | ||
Assertions.assertNotNull(openTelemetry); | ||
Assertions.assertFalse(lateBoundBatchSpanProcessorInstance.isResolvable()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>quarkus-build-parent</artifactId> | ||
<groupId>io.quarkus</groupId> | ||
<version>999-SNAPSHOT</version> | ||
<relativePath>../../build-parent/pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>quarkus-opentelemetry-exporter-jaeger-parent</artifactId> | ||
<name>Quarkus - OpenTelemetry Exporter - Jaeger</name> | ||
<packaging>pom</packaging> | ||
<modules> | ||
<module>deployment</module> | ||
<module>runtime</module> | ||
</modules> | ||
</project> |
Oops, something went wrong.