Prometheus与黑盒导出器配合使用以获取样本数据

问题描述

我们正在使用可按预期工作的prometheus运算符,我们现在要添加黑盒导出器

我已经使用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']

我看到它在目标上,

enter image description here

但是,我们仍然没有在Prometheus UI中看到任何example指标,您知道这里可能缺少什么吗?我应该搜索其他指标属性而不是example

enter image description here

顺便说一句,我为黑盒运行port-forward,并使用http://localhost:9115/metrics,并且我没有看到那里的example条目(请参阅认情况下的许多其他条目) ,知道有什么问题吗?我应该如何搜索

此外,如果我从调用http://localhost:9115/metric之类的go_info时获得的黑匣子导出器属性获取一项并运行execute,我会看到以下go_info{instance="bbe-prometheus-blackBox-exporter:9115",job="blackBox",version="go1.13.4"},我猜这是普罗米修斯连接到黑盒导出器,但是没有看到我在黑盒导出器中配置的指标example

更新

我已经根据@ FL3SH的注释使用了additionalScrapeConfig属性,并且在目标中看到了。我的问题是,例如,我应该如何查询Prometheus ui中的一项,让我说我想知道cncf端点是否已启动并正在运行。

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)