From bb161a4367e19026fafea39ddd3e53ba570a7cb2 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Thu, 9 Apr 2026 11:37:04 +0200 Subject: [PATCH 1/3] feat: add trace backend (jaeger) # Conflicts: # gradle/libs.versions.toml # launchers/controlplane/build.gradle.kts --- build.gradle.kts | 2 +- gradle/libs.versions.toml | 2 + k8s/apps/telemetry-config.yaml | 3 +- k8s/base/grafana.yaml | 152 ++++++++++++++++++ k8s/base/kustomization.yaml | 2 + k8s/base/loki.yaml | 123 ++++++++++++++ launchers/controlplane/build.gradle.kts | 4 + launchers/dataplane/build.gradle.kts | 3 +- launchers/identity-hub/build.gradle.kts | 6 +- .../identity-hub/src/main/docker/Dockerfile | 2 - launchers/issuerservice/build.gradle.kts | 2 + 11 files changed, 294 insertions(+), 7 deletions(-) create mode 100644 k8s/base/grafana.yaml create mode 100644 k8s/base/loki.yaml diff --git a/build.gradle.kts b/build.gradle.kts index 0482833..9b74510 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -66,7 +66,7 @@ subprojects { from(rootProject.layout.buildDirectory.dir("otel")) into(project.layout.buildDirectory.dir("otel")) } - var shadowJarTask = tasks.named("shadowJar").get(); + var shadowJarTask = tasks.named("shadowJar").get() shadowJarTask.dependsOn(copyOtelAgent) // configure the "dockerize" task diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c6cdcb4..721bc53 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -40,6 +40,8 @@ edc-transaction-pool = { module = "org.eclipse.edc:sql-pool-apache-commons", ver edc-api-control-configuration = { module = "org.eclipse.edc:control-api-configuration", version.ref = "edc" } edc-api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" } edc-fixtures-mgmtapi = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" } +edc-monitor-otel = { module = "org.eclipse.edc:otel-monitor", version.ref = "edc" } +edc-monitor-console = { module = "org.eclipse.edc:console-monitor", version.ref = "edc" } # EDC spi dependencies edc-spi-web = { module = "org.eclipse.edc:web-spi", version.ref = "edc" } diff --git a/k8s/apps/telemetry-config.yaml b/k8s/apps/telemetry-config.yaml index 3192589..4837145 100644 --- a/k8s/apps/telemetry-config.yaml +++ b/k8s/apps/telemetry-config.yaml @@ -22,4 +22,5 @@ data: OTEL_EXPORTER_OTLP_ENDPOINT: "http://jaeger.edc-v.svc.cluster.local:4318" OTEL_TRACES_EXPORTER: "otlp" OTEL_METRICS_EXPORTER: "otlp" - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: "http://prometheus.edc-v.svc.cluster.local:9090/api/v1/otlp/v1/metrics" \ No newline at end of file + OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: "http://prometheus.edc-v.svc.cluster.local:9090/api/v1/otlp/v1/metrics" + OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: "http://loki.edc-v.svc.cluster.local:3100/otlp/v1/logs" \ No newline at end of file diff --git a/k8s/base/grafana.yaml b/k8s/base/grafana.yaml new file mode 100644 index 0000000..f65032c --- /dev/null +++ b/k8s/base/grafana.yaml @@ -0,0 +1,152 @@ +# +# Copyright (c) 2026 Metaform Systems, Inc. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# +# Contributors: +# Metaform Systems, Inc. - initial API and implementation +# + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: grafana + namespace: edc-v + labels: + app: grafana + platform: edcv + type: edcv-infra +spec: + replicas: 1 + selector: + matchLabels: + app: grafana + template: + metadata: + name: grafana + labels: + app: grafana + platform: edcv + type: edcv-infra + spec: + containers: + - name: grafana + image: grafana/grafana:11.6.1 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + protocol: TCP + name: http + env: + - name: GF_AUTH_ANONYMOUS_ENABLED + value: "true" + - name: GF_AUTH_ANONYMOUS_ORG_ROLE + value: "Admin" + volumeMounts: + - name: grafana-datasources + mountPath: /etc/grafana/provisioning/datasources + volumes: + - name: grafana-datasources + configMap: + name: grafana-datasources + restartPolicy: Always + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: grafana-datasources + namespace: edc-v +data: + datasources.yaml: | + apiVersion: 1 + datasources: + - name: Prometheus + type: prometheus + uid: prometheus + url: http://prometheus.edc-v.svc.cluster.local:9090 + isDefault: true + jsonData: + timeInterval: 15s + + - name: Jaeger + type: jaeger + uid: jaeger + url: http://jaeger.edc-v.svc.cluster.local:16686 + jsonData: + tracesToLogsV2: + datasourceUid: loki + spanStartTimeShift: "-1m" + spanEndTimeShift: "1m" + filterByTraceID: true + filterBySpanID: false + tracesToMetrics: + datasourceUid: prometheus + + - name: Loki + type: loki + uid: loki + url: http://loki.edc-v.svc.cluster.local:3100 + jsonData: + derivedFields: + - name: TraceID + matcherRegex: '"traceId"\s*:\s*"(\w+)"' + url: "$${__value.raw}" + datasourceUid: jaeger + +--- +apiVersion: v1 +kind: Service +metadata: + name: grafana + namespace: edc-v +spec: + type: ClusterIP + selector: + app: grafana + ports: + - name: http + port: 3000 + targetPort: 3000 + +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: grafana + namespace: edc-v +spec: + parentRefs: + - name: edcv-gateway + hostnames: + - grafana.localhost + rules: + - matches: + - path: + type: PathPrefix + value: / + backendRefs: + - name: grafana + port: 3000 + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: grafana-dashboard-provisioning + namespace: edc-v +data: + dashboards.yaml: | + apiVersion: 1 + providers: + - name: default + orgId: 1 + type: file + disableDeletion: false + updateIntervalSeconds: 30 + options: + path: /var/lib/grafana/dashboards \ No newline at end of file diff --git a/k8s/base/kustomization.yaml b/k8s/base/kustomization.yaml index d0f61c0..564dee7 100644 --- a/k8s/base/kustomization.yaml +++ b/k8s/base/kustomization.yaml @@ -20,4 +20,6 @@ resources: - keycloak.yaml - vault.yaml - jaeger.yaml + - loki.yaml - prometheus.yaml + - grafana.yaml diff --git a/k8s/base/loki.yaml b/k8s/base/loki.yaml new file mode 100644 index 0000000..4b58f35 --- /dev/null +++ b/k8s/base/loki.yaml @@ -0,0 +1,123 @@ +# +# Copyright (c) 2026 Metaform Systems, Inc. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# +# Contributors: +# Metaform Systems, Inc. - initial API and implementation +# + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: loki + namespace: edc-v + labels: + app: loki + platform: edcv + type: edcv-infra +spec: + replicas: 1 + selector: + matchLabels: + app: loki + template: + metadata: + name: loki + labels: + app: loki + platform: edcv + type: edcv-infra + spec: + containers: + - name: loki + image: grafana/loki:3.4.2 + imagePullPolicy: IfNotPresent + args: + - -config.file=/etc/loki/config.yaml + ports: + - containerPort: 3100 + protocol: TCP + name: http + volumeMounts: + - name: loki-config + mountPath: /etc/loki + volumes: + - name: loki-config + configMap: + name: loki-config + restartPolicy: Always + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: loki-config + namespace: edc-v +data: + config.yaml: | + auth_enabled: false + + server: + http_listen_port: 3100 + + common: + ring: + instance_addr: 127.0.0.1 + kvstore: + store: inmemory + replication_factor: 1 + path_prefix: /tmp/loki + + schema_config: + configs: + - from: 2020-10-24 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + + storage_config: + filesystem: + directory: /tmp/loki/chunks + +--- +apiVersion: v1 +kind: Service +metadata: + name: loki + namespace: edc-v +spec: + type: ClusterIP + selector: + app: loki + ports: + - name: http + port: 3100 + targetPort: 3100 + +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: loki + namespace: edc-v +spec: + parentRefs: + - name: edcv-gateway + hostnames: + - loki.localhost + rules: + - matches: + - path: + type: PathPrefix + value: / + backendRefs: + - name: loki + port: 3100 diff --git a/launchers/controlplane/build.gradle.kts b/launchers/controlplane/build.gradle.kts index b403467..65b3bec 100644 --- a/launchers/controlplane/build.gradle.kts +++ b/launchers/controlplane/build.gradle.kts @@ -25,6 +25,10 @@ dependencies { runtimeOnly(libs.edcv.bom.controlplane.nats) runtimeOnly(libs.edcv.bom.controlplane.dcp) runtimeOnly(libs.edc.spi.jwt) + runtimeOnly(libs.edc.monitor.console) + runtimeOnly(libs.edc.monitor.otel) + + runtimeOnly(libs.edc.core.edrstore) runtimeOnly(libs.edc.vault.hashicorp) runtimeOnly(libs.bouncyCastle.bcprovJdk18on) runtimeOnly(libs.opentelemetry.exporter.otlp) diff --git a/launchers/dataplane/build.gradle.kts b/launchers/dataplane/build.gradle.kts index fdaddb8..91533dc 100644 --- a/launchers/dataplane/build.gradle.kts +++ b/launchers/dataplane/build.gradle.kts @@ -23,7 +23,8 @@ dependencies { runtimeOnly(project(":extensions:data-plane-certs")) runtimeOnly(libs.edc.vault.hashicorp) - + runtimeOnly(libs.edc.monitor.console) + runtimeOnly(libs.edc.monitor.otel) runtimeOnly(libs.opentelemetry.exporter.otlp) } diff --git a/launchers/identity-hub/build.gradle.kts b/launchers/identity-hub/build.gradle.kts index 2a67fd8..9b24dcf 100644 --- a/launchers/identity-hub/build.gradle.kts +++ b/launchers/identity-hub/build.gradle.kts @@ -13,9 +13,9 @@ */ plugins { - `java-library` id("application") alias(libs.plugins.shadow) + alias(libs.plugins.docker) } dependencies { @@ -25,6 +25,8 @@ dependencies { runtimeOnly(libs.edc.bom.identityhub.sql) runtimeOnly(libs.edc.core.participantcontext.config) runtimeOnly(libs.edc.store.participantcontext.config.sql) + runtimeOnly(libs.edc.monitor.console) + runtimeOnly(libs.edc.monitor.otel) runtimeOnly(libs.opentelemetry.exporter.otlp) } @@ -35,7 +37,7 @@ application { tasks.shadowJar { mergeServiceFiles() - archiveFileName.set("identity-hub.jar") + archiveFileName.set("${project.name}.jar") duplicatesStrategy = DuplicatesStrategy.INCLUDE } diff --git a/launchers/identity-hub/src/main/docker/Dockerfile b/launchers/identity-hub/src/main/docker/Dockerfile index 2d593eb..e9daeef 100644 --- a/launchers/identity-hub/src/main/docker/Dockerfile +++ b/launchers/identity-hub/src/main/docker/Dockerfile @@ -13,8 +13,6 @@ WORKDIR /app COPY ${OTEL_AGENT} opentelemetry-javaagent.jar COPY ${JAR} identity-hub.jar -EXPOSE 8080 - HEALTHCHECK --interval=5s --timeout=5s --retries=10 CMD curl --fail http://localhost:8080/api/check/health # Use "exec" for graceful termination (SIGINT) to reach JVM. diff --git a/launchers/issuerservice/build.gradle.kts b/launchers/issuerservice/build.gradle.kts index 6cf1382..51ef346 100644 --- a/launchers/issuerservice/build.gradle.kts +++ b/launchers/issuerservice/build.gradle.kts @@ -28,6 +28,8 @@ dependencies { runtimeOnly(libs.edc.bom.issuerservice.sql) runtimeOnly(libs.edc.core.participantcontext.config) runtimeOnly(libs.edc.store.participantcontext.config.sql) + runtimeOnly(libs.edc.monitor.console) + runtimeOnly(libs.edc.monitor.otel) runtimeOnly(libs.opentelemetry.exporter.otlp) } From 7247ce29de593c2860a6d72c9aa9852d2b9c89a9 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Tue, 21 Apr 2026 07:02:50 +0200 Subject: [PATCH 2/3] trigger ci From b6711a2eb729653a06fbf0bddfe6521610fa6b46 Mon Sep 17 00:00:00 2001 From: Paul Latzelsperger Date: Tue, 21 Apr 2026 07:09:01 +0200 Subject: [PATCH 3/3] remove edr store reference --- launchers/controlplane/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/launchers/controlplane/build.gradle.kts b/launchers/controlplane/build.gradle.kts index 65b3bec..6d4e32f 100644 --- a/launchers/controlplane/build.gradle.kts +++ b/launchers/controlplane/build.gradle.kts @@ -28,7 +28,6 @@ dependencies { runtimeOnly(libs.edc.monitor.console) runtimeOnly(libs.edc.monitor.otel) - runtimeOnly(libs.edc.core.edrstore) runtimeOnly(libs.edc.vault.hashicorp) runtimeOnly(libs.bouncyCastle.bcprovJdk18on) runtimeOnly(libs.opentelemetry.exporter.otlp)