metrics test #5

Merged
swordsteel merged 1 commits from feature/test into master 2025-09-22 06:29:43 +00:00
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.actuator)
implementation(aa.springboot.starter.webflux) implementation(aa.springboot.starter.webflux)
implementation("io.micrometer:micrometer-tracing:1.4.4") implementation("io.micrometer:micrometer-registry-otlp")
implementation("io.micrometer:micrometer-tracing-bridge-otel:1.4.4") implementation("io.micrometer:micrometer-registry-prometheus")
implementation("io.opentelemetry:opentelemetry-exporter-otlp:1.39.0") implementation("io.micrometer:micrometer-tracing")
implementation("io.micrometer:micrometer-tracing-bridge-otel")
implementation("io.opentelemetry:opentelemetry-exporter-otlp")
testImplementation(aa.kotlin.junit5) testImplementation(aa.kotlin.junit5)
testImplementation(aa.kotlinx.coroutines.test) testImplementation(aa.kotlinx.coroutines.test)

View File

@@ -17,12 +17,14 @@ management:
show-details: always show-details: always
info: info:
access: read_only access: read_only
prometheus:
access: read_only
endpoints: endpoints:
access: access:
default: none default: none
web: web:
exposure: exposure:
include: "health,info" include: "health,info,prometheus"
tracing: tracing:
sampling: sampling:
probability: '1.0' probability: '1.0'
@@ -57,4 +59,11 @@ spring:
management: management:
otlp: otlp:
tracing: 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