This is an automated email from the ASF dual-hosted git repository. rzo1 pushed a commit to branch TOMEE-4343 in repository https://gitbox.apache.org/repos/asf/tomee.git
commit 9ce9cc4ea94d41567cb9a3dfbd7f86bfcd2ad788 Author: Richard Zowalla <r...@apache.org> AuthorDate: Thu May 30 21:16:37 2024 +0200 TOMEE-4343 - WIP: OpenTelemetry 1.0 --- boms/tomee-microprofile/pom.xml | 220 +++++++++++++++++++++ boms/tomee-plume/pom.xml | 220 +++++++++++++++++++++ boms/tomee-plus/pom.xml | 220 +++++++++++++++++++++ pom.xml | 3 +- tck/microprofile-tck/opentelemetry/pom.xml | 152 ++++++++++++++ .../tck/opentelemetry/ArquillianExtension.java | 26 +++ .../tck/opentelemetry/ArquillianLifecycle.java | 29 +++ .../tck/opentelemetry/TestConfigSource.java | 31 +++ .../src/test/resources/arquillian.xml | 69 +++++++ .../src/test/resources/exclusions.txt | 5 + ...rg.eclipse.microprofile.config.spi.ConfigSource | 1 + ...org.jboss.arquillian.core.spi.LoadableExtension | 1 + tck/microprofile-tck/pom.xml | 1 + tomee/tomee-microprofile/mp-common/pom.xml | 39 ++++ .../microprofile/TomEEMicroProfileListener.java | 1 + 15 files changed, 1017 insertions(+), 1 deletion(-) diff --git a/boms/tomee-microprofile/pom.xml b/boms/tomee-microprofile/pom.xml index f13aa68a1f..10e0ff2c9c 100644 --- a/boms/tomee-microprofile/pom.xml +++ b/boms/tomee-microprofile/pom.xml @@ -243,6 +243,193 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-annotations-support</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-annotations</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-api-semconv</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-api</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-api-events</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-api</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-context</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-extension-annotations</artifactId> + <version>1.18.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-extension-incubator</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-common</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-extension-autoconfigure-spi</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-logs</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-metrics</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-trace</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-semconv</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>io.opentracing.contrib</groupId> <artifactId>opentracing-concurrent</artifactId> @@ -430,6 +617,39 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-api</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-cdi</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-rest</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>io.smallrye</groupId> <artifactId>jandex</artifactId> diff --git a/boms/tomee-plume/pom.xml b/boms/tomee-plume/pom.xml index d3a6afd36c..87c58c84bf 100644 --- a/boms/tomee-plume/pom.xml +++ b/boms/tomee-plume/pom.xml @@ -243,6 +243,193 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-annotations-support</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-annotations</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-api-semconv</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-api</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-api-events</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-api</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-context</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-extension-annotations</artifactId> + <version>1.18.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-extension-incubator</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-common</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-extension-autoconfigure-spi</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-logs</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-metrics</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-trace</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-semconv</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>io.opentracing.contrib</groupId> <artifactId>opentracing-concurrent</artifactId> @@ -430,6 +617,39 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-api</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-cdi</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-rest</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>io.smallrye</groupId> <artifactId>jandex</artifactId> diff --git a/boms/tomee-plus/pom.xml b/boms/tomee-plus/pom.xml index 7efda24008..e4a20da98e 100644 --- a/boms/tomee-plus/pom.xml +++ b/boms/tomee-plus/pom.xml @@ -243,6 +243,193 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-annotations-support</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-annotations</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-api-semconv</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry.instrumentation</groupId> + <artifactId>opentelemetry-instrumentation-api</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-api-events</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-api</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-context</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-extension-annotations</artifactId> + <version>1.18.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-extension-incubator</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-common</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-extension-autoconfigure-spi</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-logs</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-metrics</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk-trace</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-sdk</artifactId> + <version>1.29.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.opentelemetry</groupId> + <artifactId>opentelemetry-semconv</artifactId> + <version>1.29.0-alpha</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>io.opentracing.contrib</groupId> <artifactId>opentracing-concurrent</artifactId> @@ -430,6 +617,39 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-api</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-cdi</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-rest</artifactId> + <version>2.6.0</version> + <exclusions> + <exclusion> + <artifactId>*</artifactId> + <groupId>*</groupId> + </exclusion> + </exclusions> + </dependency> <dependency> <groupId>io.smallrye</groupId> <artifactId>jandex</artifactId> diff --git a/pom.xml b/pom.xml index ccffcf2f77..ca24fb3d62 100644 --- a/pom.xml +++ b/pom.xml @@ -186,6 +186,7 @@ <version.microprofile.metrics>5.0.2</version.microprofile.metrics> <version.microprofile.openapi>3.1.1</version.microprofile.openapi> <version.microprofile.opentracing>3.0</version.microprofile.opentracing> + <version.microprofile.opentelemetry>1.0</version.microprofile.opentelemetry> <version.microprofile.rest-client>3.0.1</version.microprofile.rest-client> <version.io.opentracing>0.33.0</version.io.opentracing> @@ -197,6 +198,7 @@ <version.microprofile.impl.metrics>5.0.1</version.microprofile.impl.metrics> <version.microprofile.impl.openapi>3.10.0</version.microprofile.impl.openapi> <version.microprofile.impl.opentracing>3.0.3</version.microprofile.impl.opentracing> + <version.microprofile.impl.opentelemetry>2.6.0</version.microprofile.impl.opentelemetry> <!-- Jackson and snakeyaml required by OpenAPI Impl --> <version.jackson>2.16.2</version.jackson> @@ -1044,7 +1046,6 @@ </dependency> <!-- Following dependencies remain to be cleaned up --> - <dependency> <groupId>${project.groupId}</groupId> <artifactId>jakartaee-api</artifactId> diff --git a/tck/microprofile-tck/opentelemetry/pom.xml b/tck/microprofile-tck/opentelemetry/pom.xml new file mode 100644 index 0000000000..4c1d6d7ca2 --- /dev/null +++ b/tck/microprofile-tck/opentelemetry/pom.xml @@ -0,0 +1,152 @@ +<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tomee</groupId> + <artifactId>microprofile-tck</artifactId> + <version>10.0.0-M2-SNAPSHOT</version> + </parent> + + <artifactId>microprofile-opentelemetry-tck</artifactId> + + <name>TomEE :: TCK :: MicroProfile Open Telemetry TCK</name> + + <build> + <plugins> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>3.0.0-M6</version> + <configuration> + <dependenciesToScan> + <dependency>org.eclipse.microprofile.telemetry.tracing:microprofile-telemetry-tracing-tck</dependency> + </dependenciesToScan> + <excludesFile>src/test/resources/exclusions.txt</excludesFile> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>mp-tck-all</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <executions> + <execution> + <id>tomee-plus</id> + <goals> + <goal>test</goal> + </goals> + <configuration> + <systemPropertyVariables> + <arquillian.launch>tomee-plus</arquillian.launch> + </systemPropertyVariables> + </configuration> + </execution> + <execution> + <id>tomee-plume</id> + <goals> + <goal>test</goal> + </goals> + <configuration> + <systemPropertyVariables> + <arquillian.launch>tomee-plume</arquillian.launch> + </systemPropertyVariables> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + + <dependencies> + + <dependency> + <groupId>org.eclipse.microprofile.telemetry.tracing</groupId> + <artifactId>microprofile-telemetry-tracing-tck</artifactId> + <version>${version.microprofile.opentelemetry}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.tomee</groupId> + <artifactId>jakartaee-api</artifactId> + <version>${version.jakartaee-api}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + <version>${version.cxf}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.apache.johnzon</groupId> + <artifactId>johnzon-core</artifactId> + </dependency> + <dependency> + <groupId>org.apache.johnzon</groupId> + <artifactId>johnzon-mapper</artifactId> + </dependency> + <dependency> + <groupId>org.apache.johnzon</groupId> + <artifactId>johnzon-jsonb</artifactId> + </dependency> + <dependency> + <groupId>org.apache.johnzon</groupId> + <artifactId>johnzon-jaxrs</artifactId> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>apache-tomee</artifactId> + <version>${project.version}</version> + <type>zip</type> + <classifier>microprofile</classifier> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>arquillian-tomee-remote</artifactId> + <version>${project.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.jboss.arquillian.testng</groupId> + <artifactId>arquillian-testng-container</artifactId> + <version>1.7.1.Final</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.eclipse.microprofile.config</groupId> + <artifactId>microprofile-config-api</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>io.smallrye.config</groupId> + <artifactId>smallrye-config-common</artifactId> + <version>${version.microprofile.impl.config}</version> + <scope>test</scope> + </dependency> + + </dependencies> + +</project> \ No newline at end of file diff --git a/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianExtension.java b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianExtension.java new file mode 100644 index 0000000000..a720289ab1 --- /dev/null +++ b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianExtension.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomee.microprofile.tck.opentelemetry; + +import org.jboss.arquillian.core.spi.LoadableExtension; + +public class ArquillianExtension implements LoadableExtension { + @Override + public void register(ExtensionBuilder extensionBuilder) { + extensionBuilder.observer(ArquillianLifecycle.class); + } +} \ No newline at end of file diff --git a/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianLifecycle.java b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianLifecycle.java new file mode 100644 index 0000000000..eaf13e761b --- /dev/null +++ b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/ArquillianLifecycle.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomee.microprofile.tck.opentelemetry; + +import org.jboss.arquillian.container.spi.event.container.BeforeDeploy; +import org.jboss.arquillian.core.api.annotation.Observes; +import org.jboss.arquillian.test.spi.TestClass; + +import io.opentelemetry.api.GlobalOpenTelemetry; + +public class ArquillianLifecycle { + public void beforeDeploy(@Observes BeforeDeploy event, TestClass testClass) { + GlobalOpenTelemetry.resetForTest(); + } +} \ No newline at end of file diff --git a/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/TestConfigSource.java b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/TestConfigSource.java new file mode 100644 index 0000000000..35dc2491d3 --- /dev/null +++ b/tck/microprofile-tck/opentelemetry/src/test/java/org/apache/tomee/microprofile/tck/opentelemetry/TestConfigSource.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomee.microprofile.tck.opentelemetry; + +import java.util.Map; + +import io.smallrye.config.common.MapBackedConfigSource; + +public class TestConfigSource extends MapBackedConfigSource { + public TestConfigSource() { + super("TestConfigSource", + Map.of("otel.sdk.disabled", "true", + "otel.traces.exporter", "none", + "otel.metrics.exporter", "none"), + Integer.MIN_VALUE); + } +} \ No newline at end of file diff --git a/tck/microprofile-tck/opentelemetry/src/test/resources/arquillian.xml b/tck/microprofile-tck/opentelemetry/src/test/resources/arquillian.xml new file mode 100644 index 0000000000..a5125a131d --- /dev/null +++ b/tck/microprofile-tck/opentelemetry/src/test/resources/arquillian.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<arquillian xmlns="http://jboss.org/schema/arquillian" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://jboss.org/schema/arquillian + http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> + <container qualifier="tomee-microprofile" default="true"> + <configuration> + <property name="httpPort">50290</property> + <property name="ajpPort">-1</property> + <property name="stopPort">-1</property> + <property name="classifier">microprofile</property> + <property name="debug">false</property> + <property name="conf">src/test/conf</property> + <property name="dir">target/tomee</property> + <property name="appWorkingDir">target/workdir</property> + <property name="cleanOnStartUp">true</property> + <property name="properties"> + </property> + </configuration> + </container> + <container qualifier="tomee-plus"> + <configuration> + <property name="httpPort">50290</property> + <property name="ajpPort">-1</property> + <property name="stopPort">-1</property> + <property name="classifier">plus</property> + <property name="conf">src/test/conf</property> + <property name="dir">target/tomee</property> + <property name="appWorkingDir">target/workdir</property> + <property name="cleanOnStartUp">true</property> + <property name="properties"> + tomee.mp.scan = all + </property> + </configuration> + </container> + <container qualifier="tomee-plume"> + <configuration> + <property name="httpPort">50290</property> + <property name="ajpPort">-1</property> + <property name="stopPort">-1</property> + <property name="classifier">plume</property> + <property name="conf">src/test/conf</property> + <property name="dir">target/tomee</property> + <property name="appWorkingDir">target/workdir</property> + <property name="cleanOnStartUp">true</property> + <property name="properties"> + tomee.mp.scan = all + </property> + </configuration> + </container> +</arquillian> diff --git a/tck/microprofile-tck/opentelemetry/src/test/resources/exclusions.txt b/tck/microprofile-tck/opentelemetry/src/test/resources/exclusions.txt new file mode 100644 index 0000000000..4f7a00262b --- /dev/null +++ b/tck/microprofile-tck/opentelemetry/src/test/resources/exclusions.txt @@ -0,0 +1,5 @@ +# Optional tests +org.eclipse.microprofile.telemetry.tracing.tck.rest.JaegerPropagationTest +org.eclipse.microprofile.telemetry.tracing.tck.rest.B3MultiPropagationTest +org.eclipse.microprofile.telemetry.tracing.tck.rest.B3PropagationTest +org.eclipse.microprofile.telemetry.tracing.tck.async.JaxRsServerAsyncTest \ No newline at end of file diff --git a/tck/microprofile-tck/opentelemetry/src/test/resources/services/org.eclipse.microprofile.config.spi.ConfigSource b/tck/microprofile-tck/opentelemetry/src/test/resources/services/org.eclipse.microprofile.config.spi.ConfigSource new file mode 100644 index 0000000000..bf19742c90 --- /dev/null +++ b/tck/microprofile-tck/opentelemetry/src/test/resources/services/org.eclipse.microprofile.config.spi.ConfigSource @@ -0,0 +1 @@ +org.apache.tomee.microprofile.tck.opentelemetry.TestConfigSource \ No newline at end of file diff --git a/tck/microprofile-tck/opentelemetry/src/test/resources/services/org.jboss.arquillian.core.spi.LoadableExtension b/tck/microprofile-tck/opentelemetry/src/test/resources/services/org.jboss.arquillian.core.spi.LoadableExtension new file mode 100644 index 0000000000..64afb3e3dc --- /dev/null +++ b/tck/microprofile-tck/opentelemetry/src/test/resources/services/org.jboss.arquillian.core.spi.LoadableExtension @@ -0,0 +1 @@ +org.apache.tomee.microprofile.tck.opentelemetry.ArquillianExtension \ No newline at end of file diff --git a/tck/microprofile-tck/pom.xml b/tck/microprofile-tck/pom.xml index 8b91d57195..429aa6ebb4 100644 --- a/tck/microprofile-tck/pom.xml +++ b/tck/microprofile-tck/pom.xml @@ -38,6 +38,7 @@ <module>openapi</module> <module>fault-tolerance</module> <module>opentracing</module> + <module>opentelemetry</module> </modules> <dependencyManagement> diff --git a/tomee/tomee-microprofile/mp-common/pom.xml b/tomee/tomee-microprofile/mp-common/pom.xml index ae7c95379c..21f05dae32 100644 --- a/tomee/tomee-microprofile/mp-common/pom.xml +++ b/tomee/tomee-microprofile/mp-common/pom.xml @@ -288,6 +288,45 @@ </exclusions> </dependency> + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-api</artifactId> + <version>${version.microprofile.impl.opentelemetry}</version> + </dependency> + + + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-cdi</artifactId> + <version>${version.microprofile.impl.opentelemetry}</version> + <exclusions> + <exclusion> + <groupId>jakarta.enterprise</groupId> + <artifactId>jakarta.enterprise.cdi-api</artifactId> + </exclusion> + <exclusion> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta.ws.rs-api</artifactId> + </exclusion> + </exclusions> + </dependency> + + <dependency> + <groupId>io.smallrye.opentelemetry</groupId> + <artifactId>smallrye-opentelemetry-rest</artifactId> + <version>${version.microprofile.impl.opentelemetry}</version> + <exclusions> + <exclusion> + <groupId>jakarta.enterprise</groupId> + <artifactId>jakarta.enterprise.cdi-api</artifactId> + </exclusion> + <exclusion> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta.ws.rs-api</artifactId> + </exclusion> + </exclusions> + </dependency> + <!-- Jackson and snakeyaml required by OpenAPI Impl --> <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId> diff --git a/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileListener.java b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileListener.java index 9f7f3b04b5..1e685c5ab1 100644 --- a/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileListener.java +++ b/tomee/tomee-microprofile/mp-common/src/main/java/org/apache/tomee/microprofile/TomEEMicroProfileListener.java @@ -64,6 +64,7 @@ public class TomEEMicroProfileListener { "io.smallrye.opentracing.SmallRyeTracingDynamicFeature", "io.smallrye.opentracing.contrib.interceptor.OpenTracingInterceptor", "io.smallrye.faulttolerance.FaultToleranceExtension", + "io.smallrye.opentelemetry.implementation.cdi.OpenTelemetryExtension", }; public void enhanceScannableUrls(@Observes final EnhanceScannableUrlsEvent enhanceScannableUrlsEvent) {