> For the complete documentation index, see [llms.txt](https://bohans.gitbook.io/devops/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bohans.gitbook.io/devops/prometheus/prometheus-gao-jing-chu-li/qi-dong-gao-jing-gui-ze.md).

# 启动告警规则

<mark style="color:blue;">**为了能够让 Prometheus 能够启用定义的告警规则，需要在 Prometheus 的全局配置文件中通过 rule\_files 指定一组告警规则文件的访问路径。**</mark>**Prometheus 启动后会自动扫描这些路径，从而获取到文件中定义的告警规则：**

```yaml
rule_files:
  [ - <filepath_glob> ... ]
```

<mark style="color:blue;">**默认情况下 Prometheus 会每分钟对这些告警规则进行计算**</mark>，判断是否需要发送告警信息。如果用户想定义自己的告警计算周期，可以通过<mark style="color:blue;">**`evaluation_interval`**</mark>来覆盖默认的计算周期：

```yaml
global:
  [ evaluation_interval: <duration> | default = 1m ]
```
