【发布时间】:2016-08-03 05:18:28
【问题描述】:
我们有多个在数据中心运行的 Prometheus 实例(我将它们称为 DC Prometheus 实例)和一个额外的 Prometheus 实例(我们在下文中将其称为“main”),我们从 DC 收集指标Prometheus 实例使用联合功能。
主 Prometheus 正在从其自身以及 DC Prometheus 实例(每个从 localhost:9090 抓取)中抓取 {job='prometheus'} 值。
问题是 Main prometheus 抱怨样本乱序:
WARN[1585] 提取无序样本时出错 numDropped=369 source=target.go:475 target=dc1-prometheus:443
我发现这是因为在 'match[]' 参数中包含了{job="prometheus"}。
我正在尝试通过重新标记标签来解决这个问题,但是当我尝试使用单个 DC Prometheus 并不断更换时,我无法让它工作(我仍然遇到无序样本错误),而且我什至不知道在使用多个目标时该用什么来代替。
- job_name: 'federate'
scrape_interval: 15s
honor_labels: true
metrics_path: '/prometheus/federate'
scheme: 'https'
params:
'match[]':
- '{job="some-jobs-here..."}'
- '{job="prometheus"}'
relabel_configs:
- source_labels: ['instance']
target_label: 'instance'
regex: 'localhost:9090'
replacement: '??' # I've tried with 'dc1-prometheus:9090' and single target only.. no luck
target_groups:
- targets:
- 'dc1-prometheus'
- 'dc2-prometheus'
- 'dc3-prometheus'
我的问题是如何使用 relabel_configs 来摆脱乱序错误。我到处都在使用 Prometheus 0.17。
【问题讨论】:
标签: prometheus