[英]Only summary data in grafana for blackbox_exporter, not hosts separately
blackbox problem 黑盒问题
I added blackbox_exporter in my docker-compose.yml: 我在docker-compose.yml中添加了blackbox_exporter:
blackbox_exporter:
container_name: blackbox_exporter
image: prom/blackbox-exporter
restart: always
ports:
- "9115:3115"
networks:
- monitor-net
labels:
org.label-schema.group: "monitoring"
I added job into prometheus.yml: 我将工作添加到prometheus.yml中:
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [http_2xx] # Look for a HTTP 200 response.
static_configs:
- targets: ['google.com','amazon.com'] # Target to probe with https.
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox_exporter:9115 # The blackbox exporter's real hostname:port.
I added this dashboard in grafana: https://grafana.com/dashboards/5345 because screenshot on this page was exactly what I need. 我在grafana中添加了该仪表板: https ://grafana.com/dashboards/5345,因为此页面上的屏幕截图正是我所需要的。
Alas, I have only summary graphics without legend, without site-specific chapters. las,我只有摘要图形,没有图例,没有特定于站点的章节。
You can see screenshot here: 您可以在此处查看屏幕截图:
Where my actions were wrong? 我的行为错在哪里? What can I do with it?
我该怎么办?
In the config you posted, you relabel the blackbox exporter label from __param_target
to instance
but the dashboard uses target
for all the filters and also for the templating variable. 在发布的配置中,您将
__param_target
的黑盒导出器标签重新标记为instance
但是仪表板将target
用于所有过滤器以及模板变量。
Either change your config to 将您的配置更改为
- source_labels: [__param_target]
target_label: target
or adjust the queries and settings in the dashboard to use instance
. 或调整仪表板中的查询和设置以使用
instance
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.