Spring boot actuator metrics (/actuator/metrics
) comes with many default metrics. Some of them are:
"jvm.memory.max",
"jvm.threads.states",
"process.files.max",
"jvm.gc.memory.promoted",
"tomcat.servlet.error",
"system.load.average.1m",
"jvm.memory.used",
"jvm.gc.max.data.size",
"jvm.memory.committed",
"http.server.requests",
"system.cpu.count",
"logback.events",
"tomcat.global.sent",
...
Is it possible to expose only few of them? (i.e. filtering them or better yet, telling Spring boot not to collect them at all?)
You can use management.metrics.enable.*
properties to control the metrics that are enabled and bound to the meter registry. Where a metric's name is .
separated, you can disable multiple metrics with a single property. For example, to disable all jvm
properties you can use the following property:
management.metrics.enable.jvm=false
Where there are multiple properties that match the same metric, the most-specific wins. For example, to disable all jvm
metrics other than jvm.memory.max
, you can use the following properties:
management.metrics.enable.jvm=false
management.metrics.enable.jvm.memory.max=true
You can use all
to match all metrics. For example, to disable all metrics other than jvm.memory
metrics, you can use the following properties:
management.metrics.enable.all=false
management.metrics.enable.jvm.memory=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With