Add tracing 99/142899/2 master
authorFiete Ostkamp <fiete.ostkamp@telekom.de>
Mon, 12 Jan 2026 07:18:33 +0000 (08:18 +0100)
committerFiete Ostkamp <fiete.ostkamp@telekom.de>
Wed, 28 Jan 2026 07:18:04 +0000 (07:18 +0000)
- add opentelemetry based tracing
- export traces via grpc to a tracing backend
- disable tracing by default since Jaeger
  is not part of the default ONAP
  deployment via OOM

Issue-ID: POLICY-5531
Change-Id: Idf382932fa279981fd912fa63417bba92904f16b
Signed-off-by: Fiete Ostkamp <fiete.ostkamp@telekom.de>
.gitignore
main/pom.xml
main/src/main/resources/application.yaml
main/src/test/resources/application-test-mvc.yaml
main/src/test/resources/application-test.yaml

index 89ec75f..ecc4199 100644 (file)
@@ -15,3 +15,4 @@ debug-logs/
 *.ipr
 *.iws
 **/*.log
+.vscode/
index 3edc66d..1ce3bf6 100644 (file)
             <artifactId>micrometer-registry-prometheus</artifactId>
             <scope>runtime</scope>
         </dependency>
+        <dependency>
+            <groupId>io.micrometer</groupId>
+            <artifactId>micrometer-tracing-bridge-otel</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.opentelemetry</groupId>
+            <artifactId>opentelemetry-exporter-otlp</artifactId>
+            <scope>runtime</scope>
+        </dependency>
         <dependency>
             <groupId>org.hibernate.orm</groupId>
             <artifactId>hibernate-core</artifactId>
index 50b0c8a..0e34037 100644 (file)
@@ -74,3 +74,10 @@ management:
       path-mapping:
         -metrics: plain-metrics
         -prometheus: metrics
+  tracing:
+    enabled: ${TRACING_ENABLED:false}
+    sampling:
+      probability: ${TRACING_SAMPLING_PROBABILITY:1.0}
+  otlp:
+    tracing:
+      endpoint: ${TRACING_ENDPOINT:http://jaeger-collector.istio-config}:${TRACING_OTLP_PORT:4317}
index 7e0fa5e..62c1471 100644 (file)
@@ -12,3 +12,7 @@ spring:
 server:
   servlet:
     application-display-name: test-mvc
+
+management:
+  tracing:
+    enabled: false
index 82da86f..92af886 100644 (file)
@@ -8,4 +8,8 @@ spring:
       naming:
         physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
         implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy
-    open-in-view: false
\ No newline at end of file
+    open-in-view: false
+
+management:
+  tracing:
+    enabled: false