dropwizard prometheus不计算uri模板

carvr3hs  于 2021-07-12  发布在  Java
关注(0)|答案(0)|浏览(384)

我有一个dropwizard应用程序,它使用下面的依赖项向prometheus公开度量。但是,如果我创建一个端点get/v1/book/{id},那么prometheus中公开的度量将包含经过评估的请求参数。如何使用模板公开度量?
例如,如果我做了两个请求,一个用于/v1/book/a,一个用于/v1/book/b,那么prometheus中会显示两个度量(计数器、计时器和桶),而不是/v1/book/{id}。我该如何实现这种行为?
我的依赖项:

  1. <dependency>
  2. <groupId>io.dropwizard.metrics</groupId>
  3. <artifactId>metrics-core</artifactId>
  4. <version>4.1.0</version>
  5. </dependency>
  6. <dependency>
  7. <groupId>io.prometheus</groupId>
  8. <artifactId>simpleclient_dropwizard</artifactId>
  9. <version>0.6.0</version>
  10. </dependency>
  11. <dependency>
  12. <groupId>io.prometheus</groupId>
  13. <artifactId>simpleclient_servlet</artifactId>
  14. <version>0.6.0</version></dependency>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题