Add observability: real OTLP metrics/traces to grafana/otel-lgtm, Docker Compose auto-wiring, and a dual-version (Boot 4.0 vs 4.1) proof of the new OTEL_* env var support

Companion module for the rewritten ankurm.com Prometheus/Grafana monitoring post. Verified
against a real running grafana/otel-lgtm container (not mocked): 8 real requests produce a real
orders_placed_total metric queried back from the bundled Prometheus-compatible API with zero
management.otlp.* properties, auto-wired entirely by Boot's Docker Compose service-connection
detection. Two real findings surfaced along the way and documented rather than smoothed over:
@Observed silently produces no span without an explicit ObservedAspect bean (AspectJ weaving
alone is not sufficient, despite Micrometer Tracing being active), and OTEL_EXPORTER_OTLP_ENDPOINT
already worked on Boot 4.0 via Micrometer's own OtlpConfig fallback -- what's actually new in 4.1
is the rest of the standard OTEL_* surface (verified with OTEL_METRIC_EXPORT_INTERVAL against
identical source compiled on both Boot 4.0.8 and 4.1.1).

Also fixes the root README's module table, which was missing a row for
resilience4j-circuit-breaker (added in a previous commit but never indexed here).
This commit is contained in:
Claude
2026-09-18 09:32:34 +00:00
parent 320733265f
commit 03bdf7ee87
28 changed files with 1027 additions and 2 deletions
@@ -0,0 +1,29 @@
8 real requests sent to the running app:
$ for i in $(seq 1 8); do curl -s -X POST "http://localhost:8080/orders/$i"; done
Queried straight from the real Prometheus-compatible API bundled inside the grafana/otel-lgtm
container -- not the app's own /actuator endpoint, not a mock:
$ curl -s "http://localhost:9090/api/v1/query?query=orders_placed_total"
{
"status": "success",
"data": {
"resultType": "vector",
"result": [
{
"metric": {
"__name__": "orders_placed_total",
"application": "order-service",
"channel": "web",
"job": "order-service",
"service_name": "order-service"
},
"value": [1789722945.151, "8"]
}
]
}
}
Every one of the 8 POSTs landed as a real OTLP metric, pushed over the network, through the
Docker Compose auto-wired endpoint, and queried back out of the real Prometheus-compatible
backend Grafana LGTM bundles.