diff --git a/app/vmalert/README.md b/app/vmalert/README.md index aba8231d6..1d0e785e0 100644 --- a/app/vmalert/README.md +++ b/app/vmalert/README.md @@ -12,6 +12,7 @@ rules against configured address. support; * Integration with [Alertmanager](https://github.com/prometheus/alertmanager); * Keeps the alerts [state on restarts](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/app/vmalert#alerts-state-on-restarts); +* Graphite datasource can be used for alerting and recording rules. See [these docs](#graphite) for details. * Lightweight without extra dependencies. ### Limitations: @@ -105,7 +106,13 @@ The syntax for alerting rule is following: # The name of the alert. Must be a valid metric name. alert: -# The MetricsQL expression to evaluate. +# Optional type for the rule. Supported values: "graphite", "prometheus". +# By default "prometheus" rule type is used. +[ type: ] + +# The expression to evaluate. The expression language depends on the type value. +# By default MetricsQL expression is used. If type="graphite", then the expression +# must contain valid Graphite expression. expr: # Alerts are considered firing once they have been returned for this long. @@ -128,7 +135,13 @@ The syntax for recording rules is following: # The name of the time series to output to. Must be a valid metric name. record: -# The MetricsQL expression to evaluate. +# Optional type for the rule. Supported values: "graphite", "prometheus". +# By default "prometheus" rule type is used. +[ type: ] + +# The expression to evaluate. The expression language depends on the type value. +# By default MetricsQL expression is used. If type="graphite", then the expression +# must contain valid Graphite expression. expr: # Labels to add or overwrite before storing the result. @@ -166,6 +179,13 @@ Used as alert source in AlertManager. * `http:///-/reload` - hot configuration reload. +### Graphite + +vmalert sends requests to `<-datasource.url>/render?format=json` during evaluation of alerting and recording rules +if the corresponding rule contains `type: "graphite"` config option. It is expected that the `<-datasource.url>/render` +implements [Graphite Render API](https://graphite.readthedocs.io/en/stable/render_api.html) for `format=json`. + + ### Configuration The shortlist of configuration flags is the following: diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6cfddee4f..1b3641894 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,6 +6,7 @@ * FEATURE: added `-loggerTimezone` command-line flag for adjusting time zone for timestamps in log messages. By default UTC is used. * FEATURE: added `-search.maxStepForPointsAdjustment` command-line flag, which can be used for disabling adjustment for points returned by `/api/v1/query_range` handler if such points have timestamps closer than `-search.latencyOffset` to the current time. Such points may contain incomplete data, so they are substituted by the previous values for `step` query args smaller than one minute by default. * FEATURE: vmalert: added `-datasource.queryStep` command-line flag for passing optional `step` query arg to `/api/v1/query` endpoint. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1025 +* FEATURE: vmalert: added ability to query Graphite datasource when evaluating alerting and recording rules. See [these docs](https://victoriametrics.github.io/vmalert.html#graphite) for details. * FEATURE: vmagent: added `-remoteWrite.roundDigits` command-line option for rounding metric values to the given number of decimal digits after the point before sending the metric to the corresponding `-remoteWrite.url`. This option can be used for improving data compression on the remote storage, because values with lower number of decimal digits can be compressed better than values with bigger number of decimal digits. * FEATURE: vmagent: added `-remoteWrite.rateLimit` command-line flag for limiting data transfer rate to `-remoteWrite.url`. This may be useful when big amounts of buffered data is sent after temporarily unavailability of the remote storage. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1035 * FEATURE: vmagent: export `vm_promscrape_scrapes_failed_per_url_total` and `vm_promscrape_scrapes_skipped_by_sample_limit_per_url_total` counters, which may help identifying improperly working scrape targets. diff --git a/docs/vmalert.md b/docs/vmalert.md index aba8231d6..1d0e785e0 100644 --- a/docs/vmalert.md +++ b/docs/vmalert.md @@ -12,6 +12,7 @@ rules against configured address. support; * Integration with [Alertmanager](https://github.com/prometheus/alertmanager); * Keeps the alerts [state on restarts](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/app/vmalert#alerts-state-on-restarts); +* Graphite datasource can be used for alerting and recording rules. See [these docs](#graphite) for details. * Lightweight without extra dependencies. ### Limitations: @@ -105,7 +106,13 @@ The syntax for alerting rule is following: # The name of the alert. Must be a valid metric name. alert: -# The MetricsQL expression to evaluate. +# Optional type for the rule. Supported values: "graphite", "prometheus". +# By default "prometheus" rule type is used. +[ type: ] + +# The expression to evaluate. The expression language depends on the type value. +# By default MetricsQL expression is used. If type="graphite", then the expression +# must contain valid Graphite expression. expr: # Alerts are considered firing once they have been returned for this long. @@ -128,7 +135,13 @@ The syntax for recording rules is following: # The name of the time series to output to. Must be a valid metric name. record: -# The MetricsQL expression to evaluate. +# Optional type for the rule. Supported values: "graphite", "prometheus". +# By default "prometheus" rule type is used. +[ type: ] + +# The expression to evaluate. The expression language depends on the type value. +# By default MetricsQL expression is used. If type="graphite", then the expression +# must contain valid Graphite expression. expr: # Labels to add or overwrite before storing the result. @@ -166,6 +179,13 @@ Used as alert source in AlertManager. * `http:///-/reload` - hot configuration reload. +### Graphite + +vmalert sends requests to `<-datasource.url>/render?format=json` during evaluation of alerting and recording rules +if the corresponding rule contains `type: "graphite"` config option. It is expected that the `<-datasource.url>/render` +implements [Graphite Render API](https://graphite.readthedocs.io/en/stable/render_api.html) for `format=json`. + + ### Configuration The shortlist of configuration flags is the following: