metrics test
All checks were successful
Gradle Build on PR / call-gradle-build (pull_request) Successful in 4m0s
Publish Snapshot / call-publish (push) Successful in 6m28s

This commit was merged in pull request #5.
This commit is contained in:
2025-09-21 07:29:13 +02:00
parent 67dbd928fd
commit 9015d78b37
3 changed files with 25 additions and 5 deletions

9
.http/actuator.http Normal file
View File

@@ -0,0 +1,9 @@
### Thing
GET http://localhost:8080/actuator
### info
GET http://localhost:8080/actuator/info
### Prometheus
GET http://localhost:8080/actuator/prometheus

View File

@@ -14,9 +14,11 @@ dependencies {
implementation(aa.springboot.starter.actuator)
implementation(aa.springboot.starter.webflux)
implementation("io.micrometer:micrometer-tracing:1.4.4")
implementation("io.micrometer:micrometer-tracing-bridge-otel:1.4.4")
implementation("io.opentelemetry:opentelemetry-exporter-otlp:1.39.0")
implementation("io.micrometer:micrometer-registry-otlp")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation("io.micrometer:micrometer-tracing")
implementation("io.micrometer:micrometer-tracing-bridge-otel")
implementation("io.opentelemetry:opentelemetry-exporter-otlp")
testImplementation(aa.kotlin.junit5)
testImplementation(aa.kotlinx.coroutines.test)

View File

@@ -17,12 +17,14 @@ management:
show-details: always
info:
access: read_only
prometheus:
access: read_only
endpoints:
access:
default: none
web:
exposure:
include: "health,info"
include: "health,info,prometheus"
tracing:
sampling:
probability: '1.0'
@@ -57,4 +59,11 @@ spring:
management:
otlp:
tracing:
endpoint: http://jaeger-collector.jaeger.svc.cluster.local:4318/v1/traces
endpoint: http://opentelemetry-collector.observability.svc.cluster.local:4318/v1/traces
metrics:
export:
url: http://opentelemetry-collector.observability.svc.cluster.local:4318/v1/metrics # Or gRPC: http://... but stick to HTTP for consistency
metrics:
export:
otlp:
step: 30s # Optional: Push every 30s for demo; default 60s