我的刮擦间隔和评估间隔彼此相差很远,如下所示(15s vs 4m)。当我向端点提供指标时,我发现规则每 4m 进行一次评估,这是预期的。但是,我不明白的是,它不会评估过去 4 分钟提供的所有指标的规则。我很难理解两个时钟(刮擦和评估)的功能。此外,这方面的文档非常稀少。任何指针都会有很大帮助。我毫不犹豫地将刮擦时间和评估时间更改为各 15 秒。但我需要了解将时钟分开的后果。
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 4m # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- testmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
- "/etc/prometheus/xyz_rule.yml"
- "/etc/prometheus/pqr_rule.yml"
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
metrics_path: /v1/metrics/xyz
# scheme defaults to 'http'.
static_configs:
- targets: ['test:7070']