我的要求很简单,我们有2个内部url,即hostname:80/test1
和hostname: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__