Skip to content

Commit

Permalink
docs: update vmalert and vmagent docs (#6207)
Browse files Browse the repository at this point in the history
* restore and actualize doc section explaining duplicated labels error
* rm misleading comment about post-aggregation in stream aggregation

(cherry picked from commit e3c226c)
  • Loading branch information
Haleygo authored and hagen1778 committed Apr 30, 2024
1 parent 916170c commit abd29c1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/vmalert/rule/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Rule interface {
close()
}

var errDuplicate = errors.New("result contains metrics with the same labelset after applying rule labels. See https://docs.victoriametrics.com/vmalert/#series-with-the-same-labelset for details")
var errDuplicate = errors.New("result contains metrics with the same labelset during evaluation. See https://docs.victoriametrics.com/vmalert/#series-with-the-same-labelset for details")

type ruleState struct {
sync.RWMutex
Expand Down
3 changes: 0 additions & 3 deletions docs/stream-aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,6 @@ some_counter:5m_increase / 5m

This is similar to `rate(some_counter[5m])`.

Please note, opposite to [rate](https://docs.victoriametrics.com/metricsql/#rate), `increase` aggregations can be
combined safely afterwards. This is helpful when the aggregation is calculated by more than one vmagent.

Aggregating irregular and sporadic metrics (received from [Lambdas](https://aws.amazon.com/lambda/)
or [Cloud Functions](https://cloud.google.com/functions)) can be controlled via [staleness_interval](#staleness) option.

Expand Down
19 changes: 19 additions & 0 deletions docs/vmalert.md
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,25 @@ max(vmalert_alerting_rules_last_evaluation_series_fetched) by(group, alertname)
See more details [here](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4039).
This feature is available only if vmalert is using VictoriaMetrics v1.90 or higher as a datasource.

### Series with the same labelset

vmalert can produce the following error message:
```
result contains metrics with the same labelset during evaluation
```

The error means there is a collision between [time series](https://docs.victoriametrics.com/keyConcepts.html#time-series)
during evaluation.

For example, a rule with `expr: {__name__=~"vmalert_alerts_.*"} > 0` returns two distinct time series in response:
```
{__name__="vmalert_alerts_pending",job="vmalert",alertname="HostContextSwitching"} 12
{__name__="vmalert_alerts_firing",job="vmalert",alertname="HostContextSwitching"} 0
```

As label `__name__` will be dropped during evaluation, leads to duplicated time series.
To fix this, one could use function like [label_replace](https://docs.victoriametrics.com/metricsql/#label_replace) to preserve the distinct labelset.

## mTLS protection

By default `vmalert` accepts http requests at `8880` port (this port can be changed via `-httpListenAddr` command-line flags),
Expand Down

0 comments on commit abd29c1

Please sign in to comment.