From 2c933531730de5348bd5e85fb79734b23bc8d6d5 Mon Sep 17 00:00:00 2001 From: hagen1778 Date: Wed, 30 Oct 2024 12:38:47 +0100 Subject: [PATCH] docs: add frequently asked questions to vmalert integration with vlogs Signed-off-by: hagen1778 --- docs/VictoriaLogs/vmalert.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/VictoriaLogs/vmalert.md b/docs/VictoriaLogs/vmalert.md index 4b4cb4d0e..837bba2f8 100644 --- a/docs/VictoriaLogs/vmalert.md +++ b/docs/VictoriaLogs/vmalert.md @@ -205,4 +205,35 @@ requestDurationQuantile{stats_result="p00", service="service-2"} ... ``` -For additional tips on writing LogsQL, refer to this [doc](https://docs.victoriametrics.com/victorialogs/logsql/#performance-tips). \ No newline at end of file +For additional tips on writing LogsQL, refer to this [doc](https://docs.victoriametrics.com/victorialogs/logsql/#performance-tips). + +## Frequently Asked Questions + +* How to use [multitenancy](https://docs.victoriametrics.com/victorialogs/#multitenancy) in vmalert? + * vmalert doesn't support multi-tenancy for VictoriaLogs in the same way as it [supports it for VictoriaMetrics in ENT version](https://docs.victoriametrics.com/vmalert/#multitenancy). + However, it is possible to specify the queried tenant from VictoriaLogs datasource via `headers` param in [Group config](https://docs.victoriametrics.com/vmalert/#groups). + For example, the following config will execute all the rules within the group against tenant with `AccountID=1` and `ProjectID=2`: + ```yaml + groups: + - name: MyGroup + headers: + - "AccountID: 1" + - "ProjectID: 2" + rules: ... + ``` +* How to use one vmalert for VictoriaLogs and VictoriaMetrics rules in the same time? + * vmalert allows having many groups with different rule types (`vlogs`, `prometheus`, `graphite`). + But only one `-datasource.url` cmd-line flag can be specified, so it can't be configured with more than 1 datasource. + However, VictoriaMetrics and VictoriaLogs datasources have different query path prefixes, and it is possible to use [vmauth](https://docs.victoriametrics.com/vmauth/) to route requests of different types between datasources. + See example of vmauth config for such routing below: + ```yaml + unauthorized_user: + url_map: + - src_paths: + - "/api/v1/query.*" + url_prefix: "http://victoriametrics:8428" + - src_paths: + - "/select/logsql/.*" + url_prefix: "http://victorialogs:9428" + ``` + Now, vmalert needs to be configured with `--datasource.url=http://vmauth:8427/` to send queries to vmauth, and vmauth will route them to the specified destinations as in configuration example above. \ No newline at end of file