Add tracing and metrics to intent-analysis service 88/140188/2
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Wed, 12 Feb 2025 08:46:13 +0000 (09:46 +0100)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Wed, 12 Feb 2025 09:13:03 +0000 (10:13 +0100)
- support tracing and metrics
- bump snapshot version to 15.0.1-SNAPSHOT

Issue-ID: USECASEUI-867
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: I4b147cee2175ef4fc7a77c1a4e7f3b11891787b2

intentanalysis/pom.xml
intentanalysis/src/main/resources/application.yaml
pom.xml
version.properties

index ea7e484..4f30435 100644 (file)
     <parent>
         <groupId>org.onap.usecase-ui.intent-analysis</groupId>
         <artifactId>usecase-ui-intent-analysis-parent</artifactId>
-        <version>15.0.0-SNAPSHOT</version>
+        <version>15.0.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.onap.usecase-ui.intent-analysis</groupId>
     <artifactId>usecase-ui.intent-analysis</artifactId>
-    <version>15.0.0-SNAPSHOT</version>
+    <version>15.0.1-SNAPSHOT</version>
     <name>intent-analysis</name>
     <description>Source Code for Intent Analysis Server</description>
 
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.micrometer</groupId>
+            <artifactId>micrometer-tracing-bridge-otel</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.opentelemetry</groupId>
+            <artifactId>opentelemetry-exporter-zipkin</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.micrometer</groupId>
+            <artifactId>micrometer-registry-prometheus</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
             <version>2.2.220</version>
             <scope>test</scope>
         </dependency>
-       <dependency>
+           <dependency>
             <groupId>com.squareup.retrofit2</groupId>
             <artifactId>retrofit</artifactId>
             <version>2.7.2</version>
index 29adf13..0661077 100644 (file)
@@ -3,6 +3,8 @@ server:
   servlet:
     context-path: /api/usecaseui-intent-analysis/v1
 spring:
+  application:
+    name: uui-intent-analysis
   main:
     allow-circular-references: true
   datasource:
@@ -20,6 +22,19 @@ mybatis:
     database-id: PostgreSQL
   mapper-locations: classpath*:mybatis/sql/*.xml
 
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+  tracing:
+    enabled: ${TRACING_ENABLED:true}
+    sampling:
+      probability: 1.0 # sample every request
+  zipkin:
+    tracing:
+      endpoint: http://${COLLECTOR_HOST:jaeger-collector.istio-system}:${COLLECTOR_PORT:9411}/api/v2/spans
+
 rest:
   policy:
     username: policyadmin
diff --git a/pom.xml b/pom.xml
index 6d95fc1..3b5f31f 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <groupId>org.onap.usecase-ui.intent-analysis</groupId>
     <artifactId>usecase-ui-intent-analysis-parent</artifactId>
     <packaging>pom</packaging>
-    <version>15.0.0-SNAPSHOT</version>
+    <version>15.0.1-SNAPSHOT</version>
     <modules>
         <module>intentanalysis</module>
         <module>standalone</module>
index dd5418f..6481e8b 100644 (file)
@@ -4,7 +4,7 @@
 
 major=15
 minor=0
-patch=0
+patch=1
 
 base_version=${major}.${minor}.${patch}