diff --git a/build.gradle b/build.gradle index 4e0a58c..297da57 100644 --- a/build.gradle +++ b/build.gradle @@ -30,6 +30,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'io.micrometer:micrometer-tracing-bridge-otel' + implementation 'io.opentelemetry:opentelemetry-exporter-otlp' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.6' implementation 'org.springframework.boot:spring-boot-starter-websocket' compileOnly 'org.projectlombok:lombok' @@ -47,6 +49,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-redis' implementation 'org.web3j:core:4.10.0' implementation 'com.squareup.okhttp3:okhttp:4.12.0' + runtimeOnly 'io.micrometer:micrometer-registry-otlp' } @@ -58,4 +61,3 @@ tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } - diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 61db0da..d11f8cd 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -39,7 +39,26 @@ management: endpoints: web: exposure: - include: health + include: health,info,metrics + otlp: + metrics: + export: + url: http://ipiece-otel-collector.monitoring:4318/v1/metrics + step: 5s + + metrics: + tags: + application: ${spring.application.name} + namespace: ${K8S_NAMESPACE:unknown} + + simple: + metrics: + export: + enabled: false + prometheus: + metrics: + export: + enabled: false jwt: secret: ${JWT_SECRET}