Skip to content

Commit ddd686c

Browse files
authored
app/vmalert: rename samples to series (VictoriaMetrics#9204)
`Samples` could be confusing for users, especially for alerting rules: * we say in docs that each returned "series" will create a new alert * we say that there are "series fetched", so both columns should be either "series" or "samples". Let's rename it to `series` for consistency. ### Describe Your Changes Please provide a brief description of the changes you made. Be as specific as possible to help others understand the purpose and impact of your modifications. ### Checklist The following checks are **mandatory**: - [ ] My change adheres to [VictoriaMetrics contributing guidelines](https://docs.victoriametrics.com/victoriametrics/contributing/#pull-request-checklist). --------- Signed-off-by: hagen1778 <roman@victoriametrics.com>
1 parent 0e8007a commit ddd686c

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

app/vmalert/rule/alerting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ func (ar *AlertingRule) exec(ctx context.Context, ts time.Time, limit int) ([]pr
416416
return nil, fmt.Errorf("failed to execute query %q: %w", ar.Expr, err)
417417
}
418418

419-
ar.logDebugf(ts, nil, "query returned %d samples (elapsed: %s, isPartial: %t)", curState.Samples, curState.Duration, isPartialResponse(res))
419+
ar.logDebugf(ts, nil, "query returned %d series (elapsed: %s, isPartial: %t)", curState.Samples, curState.Duration, isPartialResponse(res))
420420
qFn := func(query string) ([]datasource.Metric, error) {
421421
res, _, err := ar.q.Query(ctx, query, ts)
422422
return res.Data, err

app/vmalert/web.qtpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
<thead>
163163
<tr>
164164
<th scope="col" style="width: 60%">Rule</th>
165-
<th scope="col" style="width: 20%" class="text-center" title="How many samples were produced by the rule">Samples</th>
165+
<th scope="col" style="width: 20%" class="text-center" title="How many series were produced by the rule">Series</th>
166166
<th scope="col" style="width: 20%" class="text-center" title="How many seconds ago rule was executed">Updated</th>
167167
</tr>
168168
</thead>
@@ -594,7 +594,7 @@
594594
<thead>
595595
<tr>
596596
<th scope="col" title="The time when event was created">Updated at</th>
597-
<th scope="col" style="width: 10%" class="text-center" title="How many samples were returned">Samples</th>
597+
<th scope="col" style="width: 10%" class="text-center" title="How many series expression returns. Each series will represent an alert.">Series returned</th>
598598
{% if seriesFetchedEnabled %}<th scope="col" style="width: 10%" class="text-center" title="How many series were scanned by datasource during the evaluation">Series fetched</th>{% endif %}
599599
<th scope="col" style="width: 10%" class="text-center" title="How many seconds request took">Duration</th>
600600
<th scope="col" class="text-center" title="Time used for rule execution">Executed at</th>

app/vmalert/web.qtpl.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/victoriametrics/vmalert.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -905,19 +905,19 @@ Rows in the section represent ordered rule evaluations and their results.
905905
Every state has the following attributes:
906906
1. `Updated at` - the real time when this rule was executed by vmalert.
907907
1. `Executed at` - `time` param that was sent within the evaluation request to datasource.
908-
1. `Samples` - the amount of data samples returned during at this evaluation. Recording rule that has 0 samples produces
909-
no results. Alerting rule that has 0 samples means `expr` condition is false and rule is in inactive state.
908+
1. `Series returned` - the amount of series returned during at this evaluation. Recording rule that has 0 series produces
909+
no results. Alerting rule that has 0 series means `expr` condition is false and rule is in inactive state.
910910
1. `Series fetched` - the amount of series scanned during query evaluation. See [never-firing alerts](#never-firing-alerts).
911911
1. `Duration` - the time it took to evaluate the rule. If `Duration` is close or bigger to evaluation interval, then this
912912
rule can skip evaluations. See how to deal with [slow queries](https://docs.victoriametrics.com/victoriametrics/troubleshooting/#slow-queries).
913913
1. `cURL` - contains an example of HTTP request sent by vmalert to the `-datasource.url` during evaluation, including all extra headers and query params.
914914
The command can be used for debugging purposes to see what vmalert receives in response from datasource.
915915
_Sensitive info is stripped from the `curl` examples - see [security](#security) section for more details._
916916

917-
If a specific state shows that there were **no samples returned** and executed **cURL command returns some data**,
917+
If a specific state shows that there were **no series returned** and executed **cURL command returns some data**,
918918
then it is likely there was no data in datasource on the moment when rule was evaluated. See about [data delay](#data-delay).
919919

920-
vmalert exposes `vmalert_recording_rules_last_evaluation_samples` for recording rules to represent the amount of samples
920+
vmalert exposes `vmalert_recording_rules_last_evaluation_samples` for recording rules to represent the amount of series
921921
returned during evaluations. The following alerting rule can be used to detect those recording rules that produce no data:
922922
```yaml
923923
- alert: RecordingRulesNoData
@@ -984,9 +984,9 @@ vmalert allows configuring more detailed logging for specific alerting or record
984984
Or for all rules within the [group](#groups) {{% available_from "v1.117.0" %}}.
985985
Just set `debug: true` in configuration and vmalert will start printing additional log messages:
986986
```sh
987-
2022-09-15T13:35:41.155Z DEBUG alerting rule "TestGroup":"Conns" (2601299393013563564) at 2022-09-15T15:35:41+02:00: query returned 0 samples (elapsed: 5.896041ms, isPartial: false)
987+
2022-09-15T13:35:41.155Z DEBUG alerting rule "TestGroup":"Conns" (2601299393013563564) at 2022-09-15T15:35:41+02:00: query returned 0 series (elapsed: 5.896041ms, isPartial: false)
988988
2022-09-15T13:35:56.149Z DEBUG datasource request: executing POST request with params "denyPartialResponse=true&query=sum%28vm_tcplistener_conns%7Binstance%3D%22localhost%3A8429%22%7D%29+by%28instance%29+%3E+0&step=15s&time=1663248945"
989-
2022-09-15T13:35:56.178Z DEBUG alerting rule "TestGroup":"Conns" (2601299393013563564) at 2022-09-15T15:35:56+02:00: query returned 1 samples (elapsed: 28.368208ms, isPartial: false)
989+
2022-09-15T13:35:56.178Z DEBUG alerting rule "TestGroup":"Conns" (2601299393013563564) at 2022-09-15T15:35:56+02:00: query returned 1 series (elapsed: 28.368208ms, isPartial: false)
990990
2022-09-15T13:35:56.178Z DEBUG datasource request: executing POST request with params "denyPartialResponse=true&query=sum%28vm_tcplistener_conns%7Binstance%3D%22localhost%3A8429%22%7D%29&step=15s&time=1663248945"
991991
2022-09-15T13:35:56.179Z DEBUG alerting rule "TestGroup":"Conns" (2601299393013563564) at 2022-09-15T15:35:56+02:00: alert 10705778000901301787 {alertgroup="TestGroup",alertname="Conns",cluster="east-1",instance="localhost:8429",replica="a"} created in state PENDING
992992
...
-2.19 KB
Binary file not shown.

0 commit comments

Comments
 (0)