From 28341c39885ae725ab380b9ba8410ba19721cc94 Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 18 Jan 2022 10:40:29 +0000 Subject: [PATCH] update wiki pages --- CHANGELOG.md | 1 + vmgateway.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eae206..4a3920f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ sort: 15 * FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): add `stripPort` template function in the same way as [Prometheus does](https://github.com/prometheus/prometheus/pull/10002). * FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert.html): add `parseDuration` template function in the same way as [Prometheus does](https://github.com/prometheus/prometheus/pull/8817). * FEATURE: [MetricsQL](https://docs.victoriametrics.com/MetricsQL.html): add `stale_samples_over_time(m[d])` function for calculating the number of [staleness marks](https://docs.victoriametrics.com/vmagent.html#prometheus-staleness-markers) for time series `m` over the duration `d`. This function may be useful for detecting flapping metrics at scrape targets, which periodically disappear and then appear again. +* FEATURE: [vmgateway](https://docs.victoriametrics.com/vmgateway.html): add support for `extra_filters` option. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1863). * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): make sure that `vmagent` replicas scrape the same targets at different time offsets when [replication is enabled in vmagent clustering mode](https://docs.victoriametrics.com/vmagent.html#scraping-big-number-of-targets). This guarantees that the [deduplication](https://docs.victoriametrics.com/#deduplication) consistently leaves samples from the same `vmagent` replica. * BUGFIX: return the proper response stub from `/api/v1/query_exemplars` handler, which is needed for Grafana v8+. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1999). diff --git a/vmgateway.md b/vmgateway.md index 1add172..bf404a2 100644 --- a/vmgateway.md +++ b/vmgateway.md @@ -40,6 +40,7 @@ jwt token must be in following format: "team": "dev", "project": "mobile" }, + "extra_filters": ["{env~=\"prod|dev\",team!=\"test\"}"], "mode": 1 } } @@ -48,7 +49,8 @@ Where: - `exp` - required, expire time in unix_timestamp. If the token expires then `vmgateway` rejects the request. - `vm_access` - required, dict with claim info, minimum form: `{"vm_access": {"tenand_id": {}}` - `tenant_id` - optional, for cluster mode, routes requests to the corresponding tenant. -- `extra_labels` - optional, key-value pairs for label filters added to the ingested or selected metrics. +- `extra_labels` - optional, key-value pairs for label filters added to the ingested or selected metrics. Multiple filters are added with `and` operation. If defined, `extra_label` from original request removed. +- `extra_filters` - optional, [series selectors](https://prometheus.io/docs/prometheus/latest/querying/basics/#time-series-selectors) added to the select query requests. Multiple selectors are added with `or` operation. If defined, `extra_filter` from original request removed. - `mode` - optional, access mode for api - read, write, or full. Supported values: 0 - full (default value), 1 - read, 2 - write. ## QuickStart