Spring 启动 management.metrics.distribution 异常

Spring boot management.metrics.distribution exception

我正在尝试在我的 spring 引导 application.properties 文件中设置这两个属性的值 -

management.metrics.distribution.maximum-expected-value=1
management.metrics.distribution.maximum-expected-value=10

management.metrics.distribution.maximum-expected-value=1s
management.metrics.distribution.maximum-expected-value=10s

每次我尝试 运行 我的应用程序设置这两个字段时,我都会遇到以下异常 -

APPLICATION FAILED TO START\n***************************\n\nDescription:\n\nFailed to bind properties under 'management.metrics.distribution.maximum-expected-value' to java.util.Map<java.lang.String, java.lang.String>:\n\n Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, java.lang.String>]\n\nAction:\n\nUpdate your application's configuration\n"}

我正在浏览文档,但他们没有显示任何示例如何正确设置这些值 - https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.1.0-RC1-Configuration-Changelog#:~:text=management.metrics.distribution,minimum%2Dexpected%2Dvalue

谁能告诉我我做错了什么?

这些属性用于配置 per-meter 最大值,您没有包含仪表名称。例如,要为以 example.meter 开头的仪表名称配置最多 10s,您可以配置 management.metrics.distribution.maximum-expected-value.example.meter=10s.

参考文档包含 a section per-meter 个属性。