Custom metrics with Micrometer
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
expose business metrics.
Planned topics
- Micrometer is Spring's metrics facade; Prometheus scrapes the output.
- Counter (orders placed), timer (checkout duration), gauge (queue size).
- Name by meaning:
shop.orders.placed, tag byresultandchannel. - High-cardinality labels (customer id) can overload the metrics backend.
Draft outline details
Demonstration
Counter.builder("shop.orders").tag("result", "placed").register(registry).increment();Check your understanding
Why not tag a metric with order id?
Show answer
Millions of series overload the backend.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.