diff --git a/docs/vmalert.md b/docs/vmalert.md index 49e916353..0f0c37c91 100644 --- a/docs/vmalert.md +++ b/docs/vmalert.md @@ -474,6 +474,23 @@ There are the following approaches exist for alerting and recording rules across For example, `-remoteWrite.url=http://vminsert:8480/insert/123/prometheus` would write recording rules to `AccountID=123`. +* To use the [multitenant endpoint](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy-via-labels) of vminsert as + the `-remoteWrite.url` and vmselect as the `-datasource.url`, add `extra_label` with tenant ID as an HTTP URL parameter for each group. + For example, run vmalert using `-datasource.url=http://vmselect:8481/select/multitenant/prometheus -remoteWrite.url=http://vminsert:8480/insert/multitenant/prometheus`, + along with the rule group: +```yaml +groups: +- name: rules_for_tenant_456:789 + params: + extra_label: [vm_account_id=456,vm_project_id=789] + rules: + # Rules for accountID=456, projectID=789 +``` + +The multitenant endpoint in vmselect is less efficient than [specifying tenants in URL](https://docs.victoriametrics.com/cluster-victoriametrics/#url-format). + +For security considerations, it is recommended restricting access to multitenant endpoints only to trusted sources, since untrusted source may break per-tenant data by writing unwanted samples or get access to data of arbitrary tenants. + * To specify `tenant` parameter per each alerting and recording group if [enterprise version of vmalert](https://docs.victoriametrics.com/enterprise/) is used with `-clusterMode` command-line flag. For example: