generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug: replace opentelemetry-sdk-extension-aws mentions (#541)
* test: adds a test-suite-xray module This adds a test-suite-xray module to verify the following dependencies are resolvables without specifying the version: io.opentelemetry:opentelemetry-exporter-otlp io.opentelemetry:opentelemetry-extension-aws io.opentelemetry.instrumentation:opentelemetry-aws-sdk-2.2 * bug: replace opentelemetry-sdk-extension-aws mentions It replaces : ``` io.opentelemetry:opentelemetry-sdk-extension-aws ``` with: ``` io.opentelemetry.contrib:opentelemetry-aws-resources ``` and: ``` io.opentelemetry.contrib:opentelemetry-aws-xray-propagator ``` see: open-telemetry/opentelemetry-java#4945 open-telemetry/opentelemetry-java#4831 it updates to https://github.com/open-telemetry/opentelemetry-java-contrib 1.34.0-Alpha > Version 1.34.0 targets the OpenTelemetry SDK 1.34.0. As we are in 1.36.0 I think this is the correct version to use for it.
- Loading branch information
Showing
7 changed files
with
68 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
plugins { | ||
id("java-library") | ||
} | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
testRuntimeOnly(mnLogging.logback.classic) | ||
|
||
testImplementation(projects.micronautTracingOpentelemetryHttp) | ||
testImplementation(libs.opentelemetry.exporter.otlp) | ||
testImplementation(libs.opentelemetry.aws.sdk) | ||
testImplementation(libs.managed.opentelemetry.contrib.aws.xray.propagator) | ||
testImplementation(libs.managed.opentelemetry.contrib.aws.resources) | ||
testRuntimeOnly(libs.junit.engine) | ||
testAnnotationProcessor(mn.micronaut.inject.java) | ||
testImplementation(mnTest.micronaut.test.junit5) | ||
|
||
} | ||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.toVersion("17") | ||
targetCompatibility = JavaVersion.toVersion("17") | ||
} |
28 changes: 28 additions & 0 deletions
28
....micronaut.tracing.opentelementry.xray.test/OpenTelemetryExclusionsConfigurationTest.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,28 @@ | ||
package io.micronaut.tracing.opentelementry.xray.test; | ||
|
||
import io.micronaut.context.annotation.Property; | ||
import io.micronaut.core.convert.format.MapFormat; | ||
import io.micronaut.test.extensions.junit5.annotation.MicronautTest; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
|
||
import static io.micronaut.core.convert.format.MapFormat.MapTransformation.FLAT; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
@MicronautTest(startApplication = false) | ||
class OpenTelemetryExclusionsConfigurationTest { | ||
|
||
@Test | ||
void possibleToRetrieveConfiguration(@Property(name = "otel") @MapFormat(transformation = FLAT) Map<String, String> otelConfig) { | ||
Map<String, String> otel = otelConfig.entrySet().stream().collect(Collectors.toMap( | ||
e -> "otel." + e.getKey(), | ||
Map.Entry::getValue | ||
)); | ||
assertEquals("/health", otel.get("otel.traces.exclusions")); | ||
assertEquals("tracecontext, baggage, xray", otel.get("otel.traces.propagator")); | ||
assertEquals("otlp", otel.get("otel.traces.exporter")); | ||
|
||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
test-suite-opentelemetry-xray/src/test/resources/application.properties
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,3 @@ | ||
otel.traces.exporter=otlp | ||
otel.traces.propagator=tracecontext, baggage, xray | ||
otel.traces.exclusions=/health |