Spring boot Springboot 2测微计注册表普罗米修斯如何创建自己的直方图桶

Spring boot Springboot 2测微计注册表普罗米修斯如何创建自己的直方图桶,spring-boot,kotlin,histogram,aop,prometheus,Spring Boot,Kotlin,Histogram,Aop,Prometheus,您好,我试图创建直方图存储桶,但在Springboot 2中,是否可以创建自定义存储桶或如下所示的等间隔存储桶 le="0.005", le="0.01" , le="0.025" , le="0.05", le="0.075" ... le="+Inf" 比如: XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",**le="0.005"**,} 0.0 XYZ_secon

您好,我试图创建直方图存储桶,但在Springboot 2中,是否可以创建自定义存储桶或如下所示的等间隔存储桶

le="0.005", le="0.01" , le="0.025" , le="0.05", le="0.075" ...  le="+Inf"
比如:

XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",**le="0.005"**,} 0.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",le="0.01",} 0.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",le="0.025",} 1.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",le="0.05",} 1.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",le="0.075",} 1.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",le="0.1",} 2.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",le="0.25",} 2.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",le="0.5",} 2.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",le="0.75",} 2.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",**le="1.0"**,} 2.0
XYZ_seconds_bucket{APP="XYZ",class="HelloController",exception="none",method="hello",**le="2.5"**,} 2.0
而不是当前输出的/actuator/prometheus如下所示:

XYZ\u seconds\u bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,**le=“0.001048576**”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,**le=“0.001398101**”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,**le=“0.001747626**”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,**le=“0.002097151**”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,**le=“0.002446676**”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“0.002796201”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“0.003145726”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“0.003495251”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“0.003844776”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“0.004194304”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“0.005592405”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“0.006990506”,}0.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“0.008388607”,}0.0
:
cket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“22.906492245”,}1.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“28.633115306”,}1.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“30.0”,}1.0
XYZ_seconds_bucket{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,le=“+Inf”,}1.0
XYZ_秒数{APP=“XYZ”,class=“HelloController”,exception=“none”,method=“hello”,}1.0
配置类看起来像

@Configuration
@EnableAutoConfiguration
@ComponentScan
class TimingConfiguration {
  @Bean
  fun timedAspect(registry: MeterRegistry?): TimedAspect {
    return TimedAspect(registry!!)
  }
}
控制器具有带注释的功能:

@Timed(description = "Get hello", histogram = true)
@GetMapping(\hello)
build.gradle具有以下依赖项:

实现(“org.springframework.boot:springbootstarter”)
实现(“org.springframework.boot:springbootstarteractivator”)
实施(“io.测微计:测微计注册普罗米修斯”)
实现(“org.springframework.boot:spring-boot-starter-aop3”)

请将您的问题编辑为更可读、更易懂的格式。这是否有帮助?