diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-12-06 18:44:10 +0100 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-12-06 20:23:43 +0100 |
commit | 8b018d4f1c8a2dbc7bf68aa3275d6756b814cd0a (patch) | |
tree | 1ce6669d6a08a4790c6cc30d27bf7e23755fc4c8 | |
parent | 0c54f901a01a12b555fe659cd2e297756c9b772e (diff) |
Add tracing to schema-service
- add tracing
- cleanup pom by removing not necessary dependencies
Issue-ID: AAI-4083
Change-Id: Ie491b8a6e20b0189473b88118f4310df8cdb4ac5
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
-rw-r--r-- | aai-schema-gen/pom.xml | 53 | ||||
-rw-r--r-- | aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java | 3 | ||||
-rw-r--r-- | aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java | 10 | ||||
-rw-r--r-- | aai-schema-service/pom.xml | 59 | ||||
-rw-r--r-- | aai-schema-service/src/main/resources/application.properties | 9 | ||||
-rw-r--r-- | pom.xml | 10 |
6 files changed, 49 insertions, 95 deletions
diff --git a/aai-schema-gen/pom.xml b/aai-schema-gen/pom.xml index 80a6440..71331ad 100644 --- a/aai-schema-gen/pom.xml +++ b/aai-schema-gen/pom.xml @@ -637,9 +637,15 @@ <artifactId>spring-webmvc</artifactId> </dependency> <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> + <exclusions> + <exclusion> + <groupId>com.vaadin.external.google</groupId> + <artifactId>android-json</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.yaml</groupId> @@ -650,7 +656,6 @@ <dependency> <groupId>org.onap.aai.aai-common</groupId> <artifactId>aai-schema-ingest</artifactId> - <version>1.9.3</version> <scope>compile</scope> <exclusions> <exclusion> @@ -687,12 +692,10 @@ <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-yaml</artifactId> - <version>2.2.3</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <!-- <version>3.7</version> --> <scope>compile</scope> </dependency> <dependency> @@ -707,47 +710,9 @@ <scope>compile</scope> </dependency> <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>java-hamcrest</artifactId> - <version>2.0.0.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest-core</artifactId> - <version>1.3</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.hamcrest</groupId> - <artifactId>hamcrest-junit</artifactId> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> - <version>4.11.0</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-api</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-params</artifactId> + <version>4.4.0</version> <scope>test</scope> </dependency> </dependencies> diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java index ca1c71e..f9884c0 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/genxsd/ConfigTranslatorForDocs.java @@ -35,9 +35,12 @@ import org.onap.aai.setup.SchemaVersion; public class ConfigTranslatorForDocs extends AAIConfigTranslator { + private final SchemaLocationsBean bean; + public ConfigTranslatorForDocs(SchemaLocationsBean bean, SchemaConfigVersions schemaConfigVersions) { super(bean, schemaConfigVersions); + this.bean = bean; } @Override diff --git a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java index c050063..9b2fa2c 100644 --- a/aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java +++ b/aai-schema-gen/src/main/java/org/onap/aai/schemagen/swagger/GenerateSwagger.java @@ -20,8 +20,9 @@ package org.onap.aai.schemagen.swagger; -import com.fasterxml.jackson.dataformat.yaml.snakeyaml.Yaml; -import com.fasterxml.jackson.dataformat.yaml.snakeyaml.constructor.SafeConstructor; +import org.yaml.snakeyaml.LoaderOptions; +import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.constructor.Constructor; import freemarker.template.Configuration; import freemarker.template.Template; @@ -109,7 +110,10 @@ public class GenerateSwagger { System.exit(1); } - Yaml yaml = new Yaml(new SafeConstructor()); + LoaderOptions loaderOptions = new LoaderOptions(); + int codePointLimit = 100 * 1024 * 1024; // 100MB + loaderOptions.setCodePointLimit(codePointLimit); + Yaml yaml = new Yaml(new Constructor(loaderOptions)); Map<String, Object> swaggerMap = null; try (BufferedReader reader = new BufferedReader(new FileReader(swaggerYamlFile))) { diff --git a/aai-schema-service/pom.xml b/aai-schema-service/pom.xml index 79fb75a..f69b2dd 100644 --- a/aai-schema-service/pom.xml +++ b/aai-schema-service/pom.xml @@ -272,36 +272,6 @@ </profiles> <dependencies> <dependency> - <groupId>jakarta.xml.bind</groupId> - <artifactId>jakarta.xml.bind-api</artifactId> - <version>3.0.0</version> - </dependency> - <dependency> - <groupId>javax.annotation</groupId> - <artifactId>javax.annotation-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>javax.el</groupId> - <artifactId>javax.el-api</artifactId> - <version>3.0.0</version> - </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>javax.el</artifactId> - <version>3.0.0</version> - </dependency> - <dependency> - <groupId>javax.jms</groupId> - <artifactId>javax.jms-api</artifactId> - <version>2.0.1</version> - </dependency> - <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>javax.ws.rs-api</artifactId> - <version>2.1</version> - </dependency> - <dependency> <groupId>com.att.eelf</groupId> <artifactId>eelf-core</artifactId> </dependency> @@ -367,6 +337,18 @@ </exclusions> </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-registry-prometheus</artifactId> + </dependency> + <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.34</version> @@ -382,12 +364,7 @@ </dependency> <dependency> <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</artifactId> + <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> @@ -395,16 +372,6 @@ <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-api</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> - <scope>test</scope> - </dependency> </dependencies> <build> <resources> diff --git a/aai-schema-service/src/main/resources/application.properties b/aai-schema-service/src/main/resources/application.properties index dd03362..8581348 100644 --- a/aai-schema-service/src/main/resources/application.properties +++ b/aai-schema-service/src/main/resources/application.properties @@ -3,10 +3,17 @@ info.build.name=@project.name@ info.build.description=@project.description@ info.build.version=@project.version@ -spring.application.name=Schema Service Microservice +spring.application.name=aai-schema-service spring.jersey.type=filter spring.main.allow-bean-definition-overriding=true +spring.sleuth.enabled=false +spring.zipkin.baseUrl=http://jaeger-collector.istio-system:9411 +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=${schema.uri.base.path} spring.autoconfigure.exclude=\ @@ -45,7 +45,6 @@ Nexus Proxy Properties and Snapshot Locations Ideally this can be overwritten at runtime per internal environment specific values at runtime --> - <aai.common.version>1.15.2</aai.common.version> <nexusproxy>https://nexus.onap.org</nexusproxy> <site.path>/content/sites/site/org/onap/aai/resources/${project.artifactId}/${project.version}</site.path> <release.path>/content/repositories/releases/</release.path> @@ -53,6 +52,8 @@ <!-- GMaven plugin uses this property to figure out the name of the docker tag --> <aai.project.version>${project.version}</aai.project.version> <checkstyle.skip>false</checkstyle.skip> + <aai.common.version>1.15.2</aai.common.version> + <spring-cloud.version>2021.0.9</spring-cloud.version> </properties> <dependencyManagement> <dependencies> @@ -66,6 +67,13 @@ <artifactId>org.eclipse.persistence.moxy</artifactId> <version>2.7.15</version> </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> |