Spring Actuator - metrics aggregation from docker containers
You need to export the metrics to a central system.
Spring Boot provides a couple of implementations of a marker interface called
Exporter
which can be used to copy metric readings from the in-memory buffers to a place where they can be analyzed and displayed.
More specifically personally I like exporting metrics to statsD
To export metrics to Statsd, make sure first that you have added
com.timgroup:java-statsd-client
as a dependency of your project (Spring Boot provides a dependency management for it). Then add aspring.metrics.export.statsd.host
value to yourapplication.properties
file. Connections will be opened to port8125
unless aspring.metrics.export.statsd.port
override is provided. You can usespring.metrics.export.statsd.prefix
if you want a custom prefix.
The information above is all from the Spring Boot documentation on metrics: https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-metrics.html