Add spring-cloud-sleuth for tracing 85/136285/3
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Thu, 19 Oct 2023 12:03:59 +0000 (14:03 +0200)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Thu, 19 Oct 2023 13:19:18 +0000 (15:19 +0200)
- add tracing dependency
- configure both b3 and w3c trace propagation formats to have interoperability between spring-boot 2 (sleuth) and spring-boot 3 (micrometer) tracing

Issue-ID: AAI-3668
Change-Id: I429247444715186be562d009f0d6a6f6ede7e1c3
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
.classpath [deleted file]
aai-resources/.classpath [deleted file]
aai-resources/.gitignore
aai-resources/pom.xml
aai-resources/src/main/resources/application.properties

diff --git a/.classpath b/.classpath
deleted file mode 100644 (file)
index c0592e8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" path=""/>
-       <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
-       <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/aai-resources/.classpath b/aai-resources/.classpath
deleted file mode 100644 (file)
index fadd195..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="optional" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="test" value="true"/>
-                       <attribute name="optional" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/docker">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="optional" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/swm">
-               <attributes>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="optional" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" output="target/classes" path="src/main/java">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" output="target/test-classes" path="src/test/java">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="maven.pomderived" value="true"/>
-                       <attribute name="test" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" path="target/generated-sources/annotations">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
-               <attributes>
-                       <attribute name="optional" value="true"/>
-                       <attribute name="test" value="true"/>
-               </attributes>
-       </classpathentry>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
index a8f03c5..47d0f72 100644 (file)
@@ -14,3 +14,5 @@ bundleconfig-local/etc/logback.xml
 *.iml
 **/dbedgerules/**
 **/oxm/**
+**/.classpath
+.classpath
\ No newline at end of file
index 4336d67..c7a32ab 100644 (file)
@@ -98,8 +98,8 @@
         <!-- Integration tests will be skipped by default. Could be enabled here or by -DskipITs=false-->
         <skipITs>true</skipITs>
 
-        <!-- https://mvnrepository.com/artifact/io.swagger/swagger-core -->
         <swagger.version>1.6.8</swagger.version>
+        <spring-cloud.version>2020.0.2</spring-cloud.version>
     </properties>
     <profiles>
         <!-- Docker profile to be used for building docker image and pushing to nexus -->
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-hateoas</artifactId>
         </dependency>
+        <dependency>
+                       <groupId>org.springframework.cloud</groupId>
+                       <artifactId>spring-cloud-starter-sleuth</artifactId>
+               </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
+          </dependency>
         <dependency>
             <groupId>io.micrometer</groupId>
             <artifactId>micrometer-spring-legacy</artifactId>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>${spring-cloud.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+              </dependency>
         </dependencies>
     </dependencyManagement>
     <build>
             <plugin>
                 <groupId>org.jacoco</groupId>
                 <artifactId>jacoco-maven-plugin</artifactId>
-                <configuration combine.children="append">
+                <configuration>
                     <excludes>
                         <exclude>**/*WebSecurityConfig.*</exclude>
                     </excludes>
index 66a8e53..adf899a 100644 (file)
@@ -4,9 +4,15 @@ info.build.name=resources
 info.build.description=Resources Microservice
 info.build.version=1.1.0
 
-spring.application.name=Resources Microservice
+spring.application.name=aai-resources
 spring.jersey.type=filter
 spring.main.allow-bean-definition-overriding=true
+spring.zipkin.baseUrl=http://jaeger-collector.istio-system:9411
+spring.sleuth.messaging.jms.enabled = false
+spring.sleuth.trace-id128=true
+spring.sleuth.sampler.probability=1.0
+spring.sleuth.propagation.type=w3c, b3
+spring.sleuth.supports-join=false
 
 server.servlet.context-path=/
 spring.autoconfigure.exclude=\