Creating custom metrics

Every program manager loves metrics. In fact, a popular company (Netflix) is so well known in this arena that people describe it as a metrics-gathering company that happens to stream video.

When it comes to Spring Boot, metrics are a prime piece of Spring Boot Actuator functionality. If we visit /application/metrics, we can see a list of metrics:

    {      "names": [        "jvm.buffer.memory.used",        "jvm.memory.used",        "jvm.buffer.count",        "logback.events",        "process.uptime",        "jvm.memory.committed",        "http.server.requests",        "jvm.buffer.total.capacity",        "jvm.memory.max",        "process.starttime"      ]    }

This lists all sorts of stuff--memory, garbage collection, heap versus nonheap, threads, and more. That's nice, but what's usually needed is ...

Get Learning Spring Boot 2.0 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.