Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何为spring actuator metrics端点指定仪表过滤器?_Java_Spring Boot_Spring Boot Actuator_Micrometer_Spring Micrometer - Fatal编程技术网

Java 如何为spring actuator metrics端点指定仪表过滤器?

Java 如何为spring actuator metrics端点指定仪表过滤器?,java,spring-boot,spring-boot-actuator,micrometer,spring-micrometer,Java,Spring Boot,Spring Boot Actuator,Micrometer,Spring Micrometer,在application.properties中,我为endpoints.metrics.path添加了值。它可以工作,但它返回json,其中包含许多度量,包括jvm、tomcat、logback等,以及运行时调用的每个端点的度量和计数器 我想过滤那个端点,我已经直接添加到我的应用程序spring度量库和测微计中。因此,我当前的度量标准库是: compile 'org.springframework.boot:spring-boot-starter-actuator' compile 'io.m

在application.properties中,我为endpoints.metrics.path添加了值。它可以工作,但它返回json,其中包含许多度量,包括jvm、tomcat、logback等,以及运行时调用的每个端点的度量和计数器

我想过滤那个端点,我已经直接添加到我的应用程序spring度量库和测微计中。因此,我当前的度量标准库是:

compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'io.micrometer:micrometer-registry-prometheus:latest.release'
runtime 'io.micrometer:micrometer-spring-legacy:1.3.10'
compile 'org.springframework.metrics:spring-metrics:latest.release'
当我添加以下属性时

management.metrics.enable.jvm=false
然后我可以在Metrics.globalRegistry.getRegistries()中看到;应用它之后,jvm指标就不存在了。我还尝试用MeterFilter定义@Bean,并对其进行了调用和筛选,但在这两种情况下,这些筛选器似乎都不适用于中定义的端点的答案

endpoints.metrics.path
这个端点中的度量数据来源可能不是测微计度量数据,所以我想问,是否有一种方法可以过滤这个端点,或者是否有类似的即用端点?我的限制是springboot 1.5