[英]How to filter Spring boot actuator metrics?
Spring boot actuator metrics ( /actuator/metrics
) comes with many default metrics. Spring Boot执行器指标( /actuator/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? 是否可以只暴露其中一些? (ie filtering them or better yet, telling Spring boot not to collect them at all?) (即过滤它们或更好,告诉Spring Boot根本不收集它们?)
You can use management.metrics.enable.*
properties to control the metrics that are enabled and bound to the meter registry. 您可以使用management.metrics.enable.*
属性来控制已启用并绑定到计量表注册表的度量。 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: 例如,要禁用所有jvm
属性,可以使用以下属性:
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: 例如,要禁用除jvm.memory.max
之外的所有jvm
指标,可以使用以下属性:
management.metrics.enable.jvm=false
management.metrics.enable.jvm.memory.max=true
You can use all
to match all metrics. 您可以使用all
匹配所有指标。 For example, to disable all metrics other than jvm.memory
metrics, you can use the following properties: 例如,要禁用除jvm.memory
度量标准以外的所有度量标准,可以使用以下属性:
management.metrics.enable.all=false
management.metrics.enable.jvm.memory=true
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.