From: Fiete Ostkamp Date: Mon, 31 Mar 2025 10:02:53 +0000 (+0200) Subject: Add tracing for neng X-Git-Tag: 2.1.0~1 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F140628%2F2;p=ccsdk%2Fapps.git Add tracing for neng Updated parent version to released version 3.1.0 Issue-ID: SDNC-1854 Change-Id: I5675a1a0604daf3fd99e6d2a5e2e1735578035e6 Signed-off-by: Fiete Ostkamp --- diff --git a/ms/neng/pom.xml b/ms/neng/pom.xml index 8af3dfd1..aab48c42 100644 --- a/ms/neng/pom.xml +++ b/ms/neng/pom.xml @@ -64,7 +64,7 @@ 1.5.2 onap/ccsdk-apps-ms-neng ${maven.build.timestamp} - yyyyMMddHHmmss + yyyyMMddHHmmss ${project.version} ${maven.build.timestamp} @@ -106,6 +106,18 @@ spring-boot-starter-data-jpa compile + + org.springframework.boot + spring-boot-starter-actuator + + + io.micrometer + micrometer-tracing-bridge-otel + + + io.opentelemetry + opentelemetry-exporter-zipkin + org.apache.httpcomponents.client5 httpclient5 @@ -144,10 +156,6 @@ org.springframework spring-beans - - org.springframework - spring-beans - org.springframework spring-context @@ -376,6 +384,7 @@ org.codehaus.mojo exec-maven-plugin + 3.5.0 diff --git a/ms/neng/src/main/docker/startService.sh b/ms/neng/src/main/docker/startService.sh index 7d724f39..f568950a 100644 --- a/ms/neng/src/main/docker/startService.sh +++ b/ms/neng/src/main/docker/startService.sh @@ -7,9 +7,9 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,19 +19,22 @@ touch /app.jar APP_ARGS=-Dspring.profiles.active=${SPRING_PROFILE} -APP_ARGS=${APP_ARGS}" -Dneng_db_user="${NENG_DB_USER}" -Dneng_db_pass="${NENG_DB_PASS} -APP_ARGS=${APP_ARGS}" -Dneng_db_url="${NENG_DB_URL} -APP_ARGS=${APP_ARGS}" -Dpol_client_auth="${POL_CLIENT_AUTH} -APP_ARGS=${APP_ARGS}" -Dpol_basic_auth="${POL_BASIC_AUTH} -APP_ARGS=${APP_ARGS}" -Dpol_url="${POL_URL} -APP_ARGS=${APP_ARGS}" -Dpol_env="${POL_ENV} -APP_ARGS=${APP_ARGS}" -Dpol_req_id="${POL_REQ_ID} -APP_ARGS=${APP_ARGS}" -Daai_cert_pass="${AAI_CERT_PASS} -APP_ARGS=${APP_ARGS}" -Daai_cert_path="${AAI_CERT_PATH} -APP_ARGS=${APP_ARGS}" -Daai_uri="${AAI_URI} -APP_ARGS=${APP_ARGS}" -Daai_auth="${AAI_AUTH} -APP_ARGS=${APP_ARGS}" -cp /opt/etc/config" +APP_ARGS=${APP_ARGS} -Dneng_db_user=${NENG_DB_USER} -Dneng_db_pass=${NENG_DB_PASS} +APP_ARGS=${APP_ARGS} -Dneng_db_url=${NENG_DB_URL} +APP_ARGS=${APP_ARGS} -Dpol_client_auth=${POL_CLIENT_AUTH} +APP_ARGS=${APP_ARGS} -Dpol_basic_auth=${POL_BASIC_AUTH} +APP_ARGS=${APP_ARGS} -Dpol_url=${POL_URL} +APP_ARGS=${APP_ARGS} -Dpol_env=${POL_ENV} +APP_ARGS=${APP_ARGS} -Dpol_req_id=${POL_REQ_ID} +APP_ARGS=${APP_ARGS} -Daai_cert_pass=${AAI_CERT_PASS} +APP_ARGS=${APP_ARGS} -Daai_cert_path=${AAI_CERT_PATH} +APP_ARGS=${APP_ARGS} -Daai_uri=${AAI_URI} +APP_ARGS=${APP_ARGS} -Daai_auth=${AAI_AUTH} +APP_ARGS=${APP_ARGS} -Dspring.application.name=sdnc-network-name-gen +APP_ARGS=${APP_ARGS} -Dmanagement.tracing.enabled=${TRACING_ENABLED:false} +APP_ARGS=${APP_ARGS} -Dmanagement.tracing.sampling.probability=${TRACING_SAMPLING_PROBABILITY} +APP_ARGS=${APP_ARGS} -Dmanagement.zipkin.tracing.endpoint=${COLLECTOR_BASEURL:http://jaeger-collector.istio-config:9411}/api/v2/spans +APP_ARGS=${APP_ARGS} -cp /opt/etc/config echo "APP_ARGS ="${APP_ARGS} java -Djava.security.egd=file:/dev/./urandom ${APP_ARGS} -Xms1024m -Xmx1024m -jar /app.jar --spring.config.location=/opt/etc/config/ >(tee -a /tmp/app.out) 2> >(tee -a /tmp/app.err >&2) - diff --git a/ms/sliboot/src/main/resources/application.properties b/ms/sliboot/src/main/resources/application.properties index 5fae584e..d4465838 100644 --- a/ms/sliboot/src/main/resources/application.properties +++ b/ms/sliboot/src/main/resources/application.properties @@ -1,3 +1,4 @@ +spring.application.name=sdnc-network-name-gen springfox.documentation.swagger.v2.path=/api-docs server.servlet.context-path=/restconf server.port=8080 @@ -26,3 +27,8 @@ spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.Im spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl spring.jpa.database=mysql spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER + +management.endpoints.web.exposure.include=* +management.tracing.enabled=${TRACING_ENABLED:false} +management.tracing.sampling.probability=${SAMPLING_PROBABILITY:1.0} +management.zipkin.tracing.endpoint=${COLLECTOR_BASEURL:http://jaeger-collector.istio-config:9411}/api/v2/spans diff --git a/pom.xml b/pom.xml index 199f9dba..c95973e8 100755 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.onap.ccsdk.parent spring-boot-30-starter-parent - 3.1.0-SNAPSHOT + 3.1.0