我们正在使用按预期工作的 prometheus 运算符,我们现在要添加 blackbox 导出器
我已经使用https://github.com/helm/charts/tree/master/stable/prometheus-blackbox-exporter安装在与 Prometheus 相同的命名空间中
现在我更新了配置(values.yaml)并使用更新的新值安装图表,例如:
helm upgrade --install bbe stable/prometheus-blackbox-exporter -f values.yaml -n po
采取了默认...
targets:
- name: example # Human readable URL that will appear in Prometheus / AlertManager
url: http://example.com/healthz # The URL that blackbox will scrape
labels: {} # List of labels for ServiceMonitor. Overrides value set in `defaults`
interval: 60s # Scraping interval. Overrides value set in `defaults`
scrapeTimeout: 60s # Scrape timeout. Overrides value set in `defaults`
module: http_2xx # Module used for scraping. Overrides value set in `defaults`
https://github.com/helm/charts/blob/master/stable/prometheus-blackbox-exporter/values.yaml#L137
我已经将目标配置为使用blackbox exporter
如下
https://github.com/helm/charts/blob/master/stable/prometheus-operator/values.yaml#L1872
additionalScrapeConfigs:
- job_name: 'blackbox'
static_configs:
- targets: ['localhost:9115']
获取 svc 到命名空间返回以下内容:
bbe-prometheus-blackbox-exporter ClusterIP 100.26.213.43 9115/TCP 19h
如果我更改配置以使用以下svc
类似
additionalScrapeConfigs:
- job_name: 'blackbox'
static_configs:
- targets: ['bbe-prometheus-blackbox-exporter:9115']
我看到它在目标上,
但是,我们仍然没有example
在 Prometheus UI 中看到任何指标,知道这里可能缺少什么吗?我应该搜索其他指标属性而不是example
吗?
顺便说一句,我port-forward
为 blackbox 运行,并使用http://localhost:9115/metrics
但我没有看到那里的example
条目(看到许多其他默认出现的条目),知道可能有什么问题吗?我应该如何搜索它?
此外,如果我从调用http://localhost:9115/metric
喜欢go_info
并运行执行时获得的黑盒导出器属性中获取一个条目,我会看到以下内容go_info{instance="bbe-prometheus-blackbox-exporter:9115", job="blackbox", version="go1.13.4"}
,我猜普罗米修斯连接到黑盒导出器,但是我没有看到example
我在黑盒导出器中配置的指标
更新
我additionalScrapeConfig
根据@FL3SH 的评论使用了该属性,我在目标中看到了这一点。我的问题是例如我应该如何查询其中一个条目(在 Prometheus ui 中),假设我想知道cncf
端点是否已启动并正在运行。