From efaa8f9ce87f43b75c94ed1d09c44695e859a6cc Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Tue, 31 Oct 2017 13:29:41 +0000 Subject: [PATCH] Update getting started with new rules format --- docs/getting_started.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index d14d5df58a..028c5695ee 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -212,10 +212,14 @@ Try graphing this expression. To record the time series resulting from this expression into a new metric called `job_service:rpc_durations_seconds_count:avg_rate5m`, create a file -with the following recording rule and save it as `prometheus.rules`: +with the following recording rule and save it as `prometheus.rules.yml`: ``` -job_service:rpc_durations_seconds_count:avg_rate5m = avg(rate(rpc_durations_seconds_count[5m])) by (job, service) +groups: +- name: example + rules: + - record: job_service:rpc_durations_seconds_count:avg_rate5m + expr: avg(rate(rpc_durations_seconds_count[5m])) by (job, service) ``` To make Prometheus pick up this new rule, add a `rule_files` statement to the @@ -232,7 +236,7 @@ global: monitor: 'codelab-monitor' rule_files: - - 'prometheus.rules' + - 'prometheus.rules.yml' scrape_configs: - job_name: 'prometheus'