这是我的配置:
management.metrics.export.prometheus=true
management.metrics.export.prometheus.pushgateway.enabled=true
management.metrics.export.prometheus.pushgateway.push-rate=1m
management.metrics.export.prometheus.pushgateway.base-url=<IP>:9091
management.metrics.export.prometheus.pushgateway.job=myjob查看<IP>:9091/metrics的PushGateway端点,我看到以下标记:
{instance="",job="myjob"}理想情况下,我希望“实例”是正在运行的服务的ip地址和端口。
值得一提的是,我在Promethoues中使用了honor_labels: true。
如何设置实例标记(如果可能的话自动设置)?
谢谢
发布于 2019-09-17 19:01:41
以下内容--将其设置为分组中的键值--键映射--应该可以做到这一点:
management.metrics.export.prometheus.pushgateway.grouping-key.instance=${hostname:localhost}:${server.port}您不一定需要设置“作业”属性,因为它是从spring.application.name派生的,然后是回退。见这里。
https://stackoverflow.com/questions/57957839
复制相似问题