diff --git a/app/vmalert/README.md b/app/vmalert/README.md index d6ab0de9f1..1e637a70c3 100644 --- a/app/vmalert/README.md +++ b/app/vmalert/README.md @@ -417,6 +417,18 @@ or reducing resolution) and push results to "cold" cluster. -remoteWrite.url=http://aggregated-cluster-vminsert:8480/insert/0/prometheus # vminsert addr to persist recording rules results ``` +`vmalert` passes the configuration [recording rules](https://docs.victoriametrics.com/vmalert.html#recording-rules). These rules execute arbitrary MetricsQL expression and write the received result back to remote write destination. + +For example, for `downsampling` of the total number of requests within five minutes, the configuration file can be as follows + +``` +groups: + - name: downsampling + rules: + - record: requests:avg5m + expr: avg_over_time(my_requests_total[5m]) +``` + vmalert multi cluster Please note, [replay](#rules-backfilling) feature may be used for transforming historical data. diff --git a/docs/vmalert.md b/docs/vmalert.md index 7a562e27ca..6f0196e2ea 100644 --- a/docs/vmalert.md +++ b/docs/vmalert.md @@ -421,6 +421,18 @@ or reducing resolution) and push results to "cold" cluster. -remoteWrite.url=http://aggregated-cluster-vminsert:8480/insert/0/prometheus # vminsert addr to persist recording rules results ``` +`vmalert` passes the configuration [recording rules](https://docs.victoriametrics.com/vmalert.html#recording-rules). These rules execute arbitrary MetricsQL expression and write the received result back to remote write destination. + +For example, for `downsampling` of the total number of requests within five minutes, the configuration file can be as follows + +``` +groups: + - name: downsampling + rules: + - record: requests:avg5m + expr: avg_over_time(my_requests_total[5m]) +``` + vmalert multi cluster Please note, [replay](#rules-backfilling) feature may be used for transforming historical data.