【发布时间】:2020-02-25 07:01:01
【问题描述】:
我有一个 json 格式的传入事件(到 Spring Boot 应用程序),其中包含一个名为“组件”的字段。 我需要创建一个指标计数器并推送到每个组件的 prometheus pushgateway。 每种类型的组件都应该有单独的计数器。 如何做到这一点?
【问题讨论】:
-
您可以为此使用哈希图。 hashmap.put(component.name(), counter++) 会解决的。
-
如何使用prometheus pushgateway来实现counter metric?什么是 curl 命令?谢谢
标签: spring-boot prometheus prometheus-pushgateway