如何配置Prometheus来计算收到的url总请求数

时间:2018-12-13 20:51:09

标签: prometheus prometheus-blackbox-exporter

我的要求很简单,我们有2个内部url,即hostname:80/test1hostname:80/test2在apache上运行。我需要配置Prometheus来监视URL,并需要显示收到的对该URL的请求总数。

我已经安装了prometheus和黑匣子提供程序,我能够进行探测,但无法从仪表板获取总请求。

我的prometheus.yml如下所示,非常感谢您的帮助

global:

alerting:
alertmanagers:
- static_configs:
- targets:

rule_files:

 scrape_configs:
 - job_name: 'prometheus'
  static_configs:
  - targets:
    - hostname:9090
 - job_name: test1
   metrics_path: /probe
   params:
   module: [http_2xx]
   static_configs:
 - targets:
   - http://hostname:80/test1
   relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__

 - job_name: test2
   metrics_path: /probe
   params:
   module: [http_2xx]
   static_configs:
    - targets:
    - http://hostname:80/test2
   relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__

0 个答案:

没有答案