From a02f1220fe663366751810b461db09cdfc82dade Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 10:16:38 +0000 Subject: [PATCH 1/2] build(deps): bump io.opentelemetry.javaagent:opentelemetry-javaagent Bumps [io.opentelemetry.javaagent:opentelemetry-javaagent](https://github.com/open-telemetry/opentelemetry-java-instrumentation) from 2.4.0 to 2.5.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java-instrumentation/compare/v2.4.0...v2.5.0) --- updated-dependencies: - dependency-name: io.opentelemetry.javaagent:opentelemetry-javaagent dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3f9f9881..78f47622 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -75,7 +75,7 @@ junit-pioneer = { module = "org.junit-pioneer:junit-pioneer", version.ref = "jun okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp-mockwebserver" } opentelemetry-annotations = { module = "io.opentelemetry:opentelemetry-extension-annotations", version = "1.18.0" } opentelemetry-exporter-otlp = { module = "io.opentelemetry:opentelemetry-exporter-otlp", version = "1.39.0" } -opentelemetry-javaagent = { module = "io.opentelemetry.javaagent:opentelemetry-javaagent", version = "2.4.0" } +opentelemetry-javaagent = { module = "io.opentelemetry.javaagent:opentelemetry-javaagent", version = "2.5.0" } restAssured = { module = "io.rest-assured:rest-assured", version.ref = "restAssured" } testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" } testcontainers-junit-jupiter = { module = "org.testcontainers:junit-jupiter", version.ref = "testcontainers" } From 24a1302896676bb2d1626c04a7bc70a131f580dd Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Mon, 1 Jul 2024 11:44:23 +0200 Subject: [PATCH 2/2] fix test --- .../docker-compose.yaml | 2 +- .../open-telemetry-runtime/Dockerfile | 2 +- .../advanced/Advanced01openTelemetryTest.java | 31 +++++-------------- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/advanced/advanced-01-open-telemetry/docker-compose.yaml b/advanced/advanced-01-open-telemetry/docker-compose.yaml index f918fe2b..91d7d413 100644 --- a/advanced/advanced-01-open-telemetry/docker-compose.yaml +++ b/advanced/advanced-01-open-telemetry/docker-compose.yaml @@ -13,7 +13,7 @@ services: - "29194:29194" environment: EDC_HOSTNAME: consumer - OTEL_SERVICE_NAME: provider + OTEL_SERVICE_NAME: consumer OTEL_LOGS_EXPORTER: none OTEL_JAVAAGENT_EXTENSIONS: /app/opentelemetry-exporter-otlp.jar OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318 diff --git a/advanced/advanced-01-open-telemetry/open-telemetry-runtime/Dockerfile b/advanced/advanced-01-open-telemetry/open-telemetry-runtime/Dockerfile index 1b65b93b..9643d0e0 100644 --- a/advanced/advanced-01-open-telemetry/open-telemetry-runtime/Dockerfile +++ b/advanced/advanced-01-open-telemetry/open-telemetry-runtime/Dockerfile @@ -1,6 +1,6 @@ FROM openjdk:17-slim WORKDIR /app -COPY build/libs/opentelemetry-javaagent-2.4.0.jar /app/opentelemetry-javaagent.jar +COPY build/libs/opentelemetry-javaagent-2.5.0.jar /app/opentelemetry-javaagent.jar COPY build/libs/opentelemetry-exporter-otlp-1.39.0.jar /app/opentelemetry-exporter-otlp.jar COPY build/libs/connector.jar /app/connector.jar diff --git a/system-tests/src/test/java/org/eclipse/edc/samples/advanced/Advanced01openTelemetryTest.java b/system-tests/src/test/java/org/eclipse/edc/samples/advanced/Advanced01openTelemetryTest.java index f0571f16..2c43a224 100644 --- a/system-tests/src/test/java/org/eclipse/edc/samples/advanced/Advanced01openTelemetryTest.java +++ b/system-tests/src/test/java/org/eclipse/edc/samples/advanced/Advanced01openTelemetryTest.java @@ -15,21 +15,14 @@ package org.eclipse.edc.samples.advanced; -import org.apache.http.HttpStatus; import org.eclipse.edc.junit.annotations.EndToEndTest; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.testcontainers.containers.ComposeContainer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; -import java.io.IOException; -import java.net.HttpURLConnection; -import java.net.URL; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; +import static io.restassured.RestAssured.given; import static org.eclipse.edc.connector.controlplane.transfer.spi.types.TransferProcessStates.STARTED; import static org.eclipse.edc.samples.common.FileTransferCommon.getFileContentFromRelativePath; import static org.eclipse.edc.samples.common.FileTransferCommon.getFileFromRelativePath; @@ -54,16 +47,11 @@ public class Advanced01openTelemetryTest { private static final String JAEGER_URL = "http://localhost:16686"; @Container - public static ComposeContainer environment = + public ComposeContainer environment = new ComposeContainer(getFileFromRelativePath(DOCKER_COMPOSE_YAML)) .withLocalCompose(true) .waitingFor("consumer", Wait.forLogMessage(".*ready.*", 1)); - @BeforeAll - static void setUp() { - environment.start(); - } - @Test void runSampleSteps() { createAsset(); @@ -75,16 +63,11 @@ void runSampleSteps() { var transferRequest = getFileContentFromRelativePath(START_TRANSFER_FILE_PATH); var transferProcessId = startTransfer(transferRequest, contractAgreementId); checkTransferStatus(transferProcessId, STARTED); - assertJaegerState(); - } - private void assertJaegerState() { - try { - var url = new URL(JAEGER_URL); - var huc = (HttpURLConnection) url.openConnection(); - assertThat(huc.getResponseCode()).isEqualTo(HttpStatus.SC_OK); - } catch (IOException e) { - fail("Unable to assert Jaeger state", e); - } + given() + .baseUri(JAEGER_URL) + .get() + .then() + .statusCode(200); } }