app/vmalert: follow-up after f8ac55d70ada9ef8490b322abefb05f28f75e2e9

* Use vm_account_id and vm_project_id labels to be consistent with https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy-via-labels
* Document the feature that vmalert now exposes vm_account_id and vm_project_id
  labels if -clusterMode is set.
* Use literal strings instead of string constants for vm_account_id and vm_project_id.
  This improves code readability.
This commit is contained in:
Aliaksandr Valialkin 2022-10-05 23:57:29 +03:00
parent 703094a37a
commit c45c61cf93
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1
2 changed files with 10 additions and 0 deletions

View File

@ -331,6 +331,11 @@ groups:
# Rules for accountID=456, projectID=789 # Rules for accountID=456, projectID=789
``` ```
The results of alerting and recording rules contain `vm_account_id` and `vm_project_id` labels
if `-clusterMode` is enabled. These labels can be used during [templating](https://docs.victoriametrics.com/vmalert.html#templating).
The results of alerting and recording rules with these labels can be stored to the corresponding tenants at VictoriaMetrics cluster
via [multitenant endpoint](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy-via-labels).
If `-clusterMode` is enabled, then `-datasource.url`, `-remoteRead.url` and `-remoteWrite.url` must If `-clusterMode` is enabled, then `-datasource.url`, `-remoteRead.url` and `-remoteWrite.url` must
contain only the hostname without tenant id. For example: `-datasource.url=http://vmselect:8481`. contain only the hostname without tenant id. For example: `-datasource.url=http://vmselect:8481`.
`vmalert` automatically adds the specified tenant to urls per each recording rule in this case. `vmalert` automatically adds the specified tenant to urls per each recording rule in this case.

View File

@ -335,6 +335,11 @@ groups:
# Rules for accountID=456, projectID=789 # Rules for accountID=456, projectID=789
``` ```
The results of alerting and recording rules contain `vm_account_id` and `vm_project_id` labels
if `-clusterMode` is enabled. These labels can be used during [templating](https://docs.victoriametrics.com/vmalert.html#templating).
The results of alerting and recording rules with these labels can be stored to the corresponding tenants at VictoriaMetrics cluster
via [multitenant endpoint](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy-via-labels).
If `-clusterMode` is enabled, then `-datasource.url`, `-remoteRead.url` and `-remoteWrite.url` must If `-clusterMode` is enabled, then `-datasource.url`, `-remoteRead.url` and `-remoteWrite.url` must
contain only the hostname without tenant id. For example: `-datasource.url=http://vmselect:8481`. contain only the hostname without tenant id. For example: `-datasource.url=http://vmselect:8481`.
`vmalert` automatically adds the specified tenant to urls per each recording rule in this case. `vmalert` automatically adds the specified tenant to urls per each recording rule in this case.