Spring Boot Tutorial 0/110 lessons ~6 min read Lesson 62

    Monitoring & Logging

    You can't fix what you can't see.

    Course progress0%
    Focus
    2 guided sections
    Practice signal
    Examples included
    Career prep
    Foundation builder

    Introduction

    You can't fix what you can't see. The modern observability stack: Spring Boot Actuator (health, metrics) + Micrometer (metrics shim) + Prometheus (scrape) + Grafana (dashboards) + Loki (logs) + Tempo/Jaeger (traces).

    Informative example

    bash
    # pom.xml
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
    </dependency>
    # application.yml
    management:
    endpoints:
    web:
    exposure:
    include: health,info,metrics,prometheus
    endpoint:
    health:
    show-details: when-authorized
    metrics:
    tags:
    application: ${spring.application.name}
    # Custom metric
    @Service @RequiredArgsConstructor
    public class OrderService {
    private final MeterRegistry meter;
    public Order place(NewOrder cmd) {
    meter.counter("orders.placed", "tier", cmd.tier()).increment();
    ...
    }
    }
    Ready to mark this lesson complete?Track your journey across the entire course.