最初我们有单节点应用程序,我们使用Prometheus设置单节点应用程序的度量路径url,如下所示:
- job_name: 'spring-actuator'
metrics_path: '/prometheus'
scrape_interval: 5s现在我们切换到云应用程序,如果我们设置负载均衡器路径-它每次都会使用不同的节点,所以我们会看到一些混乱。有没有办法使用prometheus聚合集群中的指标?
发布于 2019-12-28 00:09:44
您应该使用prometheus从各个后端收集指标,然后在查询中使用聚合或预聚合数据(使用prometheus记录规则)。普罗米修斯有许多内置的服务发现机制,它们可以用来自动查找和使用你的应用程序运行的所有端点。
要体验一下配置是什么样子,可以查看示例https://github.com/prometheus/prometheus/blob/release-2.15/config/testdata/conf.good.yml#L199
根据您使用的云服务,您将使用不同的_sd_config指令。文档中描述了所有可用的https://prometheus.io/docs/prometheus/latest/configuration/configuration/
https://stackoverflow.com/questions/59503033
复制相似问题