diff --git a/.http/actuator.http b/.http/actuator.http new file mode 100644 index 0000000..50e741f --- /dev/null +++ b/.http/actuator.http @@ -0,0 +1,9 @@ +### Thing +GET http://localhost:8080/actuator + +### info +GET http://localhost:8080/actuator/info + +### Prometheus +GET http://localhost:8080/actuator/prometheus + diff --git a/build.gradle.kts b/build.gradle.kts index 4ccd765..b024562 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 21ebe89..47390ec 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -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