[英]Configure unique name per target in Prometheus Blackbox exporter
在帶有黑匣子導出器的Prometheus中,我設法為應用程序可用性配置了10個以上的URL,所有這些URL均通過其URL進行標識,其中一些比下面顯示的示例更長,因此,除了將URL顯示為實例名稱之外,我如何使用唯一標簽。
例如
static_configs:
- targets:
- https://www.google.co.in/ # called as GoogleIndia
- https://www.google.co.uk/ # called as GoogleUK
- https://www.google.fr/ # called as GoogleFrance
您可以使用metric_relabel_configs
根據您指定的實例名稱構造一個instance
(或全新的)標簽,如本博客文章中所述 。
或者,您可以像這樣指定目標,在過程中為它們分配任意標簽:
static_configs:
- targets: ['https://www.google.co.in/']
labels:
name: `GoogleIndia`
- targets: ['https://www.google.co.uk/']
labels:
name: `GoogleUK`
- targets: ['https://www.google.fr/']
labels:
name: `GoogleFrance`
它更冗長,但更易於理解,功能更強大。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.