A user files a ticket: checkout is broken.

That's it. No stack trace, no request ID, just a vague sense that something's off. How long it takes you to get from that ticket to "the orders query is missing an index" comes down to one thing — how much of your system you can actually see.

A short DevOops video I watched recently splits observability into seven levels, where each level exists to patch the blind spot the previous one leaves. I liked it enough to write it up properly, with one running incident and the config I'd actually use on a Spring Boot service. Fair warning, the last level is the one that costs money.

Level You get You still can't see
1. Logs What happened, and when The trend
2. Metrics The trend Which service is slow
3. Traces Where the time goes Why
4. Correlation Why That it's happening at all, unless you're looking
5. Alerts You hear before users do Which alerts actually matter
6. SLOs Paged only when it matters Whether you can afford all this
7. Cardinality A bill you can live with —

Level 1: Logs

Every app starts here. Something happens, you write a line.

10:24:33 ERROR payment timeout [payments] 

Fine for "what blew up at 10:24." Useless for "is this getting worse?" Is that the first timeout today or the four-hundredth? You'd have to grep and count, and you won't, not at 2am.

Tools: Grafana Loki, ELK, Cloud Logging

Level 2: Metrics

So you start emitting numbers every few seconds. The usual starting set is RED: Rate, Errors, Duration.

In Spring Boot that's mostly free. Add Actuator and the Prometheus registry and you get http_server_requests_seconds with method, status and URI template already tagged:

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency> 
management.endpoints.web.exposure.include=health,prometheus management.metrics.distribution.percentiles-histogram.http.server.requests=true 

Point Prometheus at /actuator/prometheus, build a dashboard, and the trend shows up:

  • ~120 requests/s
  • 2.1% errors
  • checkout p95 at 1.1s, up 3.4×

Great, checkout is slower. But checkout fans out to gateway, auth, orders, payments and the database. Which one?

Tools: Prometheus, Grafana

Level 3: Traces

A trace follows one request across every hop and times each step (a span).

Span Duration
gateway 15 ms
auth 30 ms
orders 80 ms
payments 120 ms
database 800 ms

Database is eating 800 of roughly 1,050 milliseconds. That's the where. Still no why.

For Spring Boot 4, Micrometer Tracing with the OpenTelemetry bridge does the heavy lifting:

<dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-tracing-bridge-otel</artifactId> </dependency> <dependency> <groupId>io.opentelemetry</groupId> <artifactId>opentelemetry-exporter-otlp</artifactId> </dependency> 
# 1.0 is fine locally. Do not ship this to prod on a busy service. management.tracing.sampling.probability=1.0 management.otlp.tracing.endpoint=http://otel-collector:4318/v1/traces 

Tools: OpenTelemetry, Jaeger, Grafana Tempo

Level 4: Correlation

This is the level I think gets underrated the most. You've got logs in one place and traces in another, and they don't know about each other.

The fix is a shared ID on everything. The video describes giving each request an ID when it lands, but you rarely need to invent one: OpenTelemetry already propagates a trace ID between services in the W3C traceparent header. The job is just getting that ID into your log lines.

With Micrometer Tracing on the classpath, Boot puts traceId and spanId in the MDC for you. Recent Boot 3.x versions include them in the default console pattern automatically; on older ones, or with a custom pattern, add it yourself:

logging.pattern.level=%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}] 

Now search the trace ID in Grafana Explore (or click straight from the slow span if you've set up Tempo → Loki links) and the log sitting next to that 800ms span says:

database WARN slow query orders table · 800 ms [no index] 

Root cause. A query on orders with no index. That whole hunt took a couple of clicks instead of an afternoon.

Level 5: Alerts

Back up a second. How did we find out about any of this? A user complained.

In the video's timeline the problem started at 10:20 and someone opened a dashboard at 10:31. Eleven minutes of the system knowing and nobody else. An alert closes that gap:

groups: - name: checkout rules: - alert: CheckoutHighErrorRate expr: | sum(rate(http_server_requests_seconds_count{uri="/checkout", status=~"5.."}[5m])) / sum(rate(http_server_requests_seconds_count{uri="/checkout"}[5m])) > 0.05 for: 5m labels: severity: page 

Note the sum() on both sides. Without it you're dividing per-series and the ratio comes out weird whenever the label sets don't line up exactly. It's an easy one to miss, because the query still returns numbers.

Errors above 5% for five minutes and your phone rings, ideally before the first ticket lands.

Tools: Alertmanager, PagerDuty, Opsgenie

Level 6: SLOs

Here's the trap with level 5. Alert on every wobble and within a month the team has muted the channel, and the one alert that matters gets ignored along with the rest.

So you decide what "good" means before you decide what to page on:

  • SLI: what you measure. Successful requests / total requests.
  • SLO: your internal target. Say 99.9% over 30 days.
  • SLA: the promise you make customers, usually with credits attached. Keep it looser than your SLO.

A 99.9% monthly target leaves you an error budget of about 43 minutes. Instead of paging on raw error rate, you page on how fast that budget is burning. The common pattern from the Google SRE workbook is a multi-window burn rate; burning at 14.4× means you'd spend 2% of the month's budget in one hour:

- alert: CheckoutErrorBudgetFastBurn expr: | ( sum(rate(http_server_requests_seconds_count{uri="/checkout", status=~"5.."}[1h])) / sum(rate(http_server_requests_seconds_count{uri="/checkout"}[1h])) ) > (14.4 * 0.001) and ( sum(rate(http_server_requests_seconds_count{uri="/checkout", status=~"5.."}[5m])) / sum(rate(http_server_requests_seconds_count{uri="/checkout"}[5m])) ) > (14.4 * 0.001) labels: severity: page 

The long window means you're not paged for a 30-second blip. The short window means the alert clears quickly once things recover. If writing these by hand sounds miserable, Sloth and Pyrra will generate them from a small SLO spec.

Tools: Grafana SLOs, Datadog, Sloth, Pyrra

Level 7 (the boss): Cardinality

You can see everything now. So naturally someone wants to measure everything, and adds a user label:

http_requests_total{method, status, region, userId} 

Every unique combination of label values is its own time series. A few methods × a few statuses × a few regions is a dozen series. Multiply by a million users and you've got millions. Prometheus memory climbs, queries crawl, and if you're on a hosted vendor that bills per custom metric series, the invoice does something you'll be explaining in a meeting.

The rules I'd hold the line on:

  • Metric labels stay few and bounded. Method, status, route template, region.
  • Never on a metric: user IDs, request IDs, emails, raw paths like /orders/98234, anything timestamp-ish.
  • High-cardinality detail lives in logs and traces, where it's expected and cheap.
http_requests_total{method, status, region} # a dozen series span attribute / log field: userId=982341 # go wild 

One Spring-specific gotcha: Micrometer tags uri with the route template (/orders/{id}) for matched routes, which is what you want. Build your own timers with request.getRequestURI() as a tag and you've quietly undone that.

So where does that leave you?

The numbering is a teaching device, not a roadmap. Lots of teams have Prometheus alerts running years before anyone sets up tracing, and that's fine. What I find useful is the question each level forces: what still can't I see?

If you can't answer "where" during an incident, you need traces. If you can't answer "why" without opening three tabs, you need correlation. If your on-call channel is on mute, you need SLOs, not more alerts.