简体   繁体   English

Dropwizard指标可跟踪传入请求中的邮政编码

[英]Dropwizard metrics to track zip codes in an incoming request

I am working on an application that accepts incoming HTTP requests and contains the user's zip code. 我正在开发一个接受传入HTTP请求并包含用户邮政编码的应用程序。 I would like to track each of the zip codes received using a metric such that it can be reported to Prometheus and graphed inside Grafana. 我想使用度量来跟踪收到的每个邮政编码,以便可以将其报告给Prometheus并在Grafana内进行绘图。 It would not make sense to have a counter for every single zip code but I worry that a Gauge would not be appropriate and Grafana would miss some of the data between Prometheus scrapes. 对于每个邮政编码,都没有一个计数器是没有意义的,但是我担心仪表不适合,并且Grafana会丢失Prometheus刮擦之间的一些数据。 Any suggestions for how I could possibly accomplish this task? 关于如何完成此任务的任何建议? We do have logging but we need this information displayed in Grafana. 我们确实有日志记录,但是我们需要在Grafana中显示此信息。

This is more a use case for logging than metrics given the cardinality. 与给定基数的指标相比,这更是日志记录的用例。

This is a use case for a label, however Dropwizard doesn't support those. 这是标签的用例,但是Dropwizard不支持这些用例。 Thus if you're going to do this with Prometheus I'd suggest using the Java client with a Counter with a label for the zip code. 因此,如果要使用Prometheus进行此操作,建议您将Java客户端与带有邮政编码标签的Counter一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM