From de3d5943eb168b83f53863ff05ec28f7e5c64610 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 15 Nov 2023 15:53:59 +0100 Subject: [PATCH] docs/stream-aggregation.md: clarify that stream aggregation is applied after all the configured relabeling This is a follow-up after 68d2cb203df2e540c1c597135b8ea20cd723bc63 --- app/vmagent/README.md | 5 ++++- docs/stream-aggregation.md | 11 ++++++----- docs/vmagent.md | 5 ++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/vmagent/README.md b/app/vmagent/README.md index a1804825e3..3a1984fa23 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -503,13 +503,16 @@ with [additional enhancements](#relabeling-enhancements). The relabeling can be This relabeling can be debugged via `http://vmagent:8429/metric-relabel-debug` page. See [these docs](#relabel-debug) for details. * At the `-remoteWrite.urlRelabelConfig` files. This relabeling is used for modifying labels for metrics - and for dropping unneeded metrics before sending them to a particular `-remoteWrite.url`. + and for dropping unneeded metrics before sending them to the particular `-remoteWrite.url`. This relabeling can be debugged via `http://vmagent:8429/metric-relabel-debug` page. See [these docs](#relabel-debug) for details. All the files with relabeling configs can contain special placeholders in the form `%{ENV_VAR}`, which are replaced by the corresponding environment variable values. +[Streaming aggregation](https://docs.victoriametrics.com/stream-aggregation.html), if configured, +is pefrormed after applying all the relabeling stages mentioned above. + The following articles contain useful information about Prometheus relabeling: * [Cookbook for common relabeling tasks](https://docs.victoriametrics.com/relabeling.html) diff --git a/docs/stream-aggregation.md b/docs/stream-aggregation.md index 1c044dc863..65a901972d 100644 --- a/docs/stream-aggregation.md +++ b/docs/stream-aggregation.md @@ -15,7 +15,8 @@ aliases: [vmagent](https://docs.victoriametrics.com/vmagent.html) and [single-node VictoriaMetrics](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html) can aggregate incoming [samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples) in streaming mode by time and by labels before data is written to remote storage. The aggregation is applied to all the metrics received via any [supported data ingestion protocol](https://docs.victoriametrics.com/#how-to-import-time-series-data) -and/or scraped from [Prometheus-compatible targets](https://docs.victoriametrics.com/#how-to-scrape-prometheus-exporters-such-as-node-exporter). +and/or scraped from [Prometheus-compatible targets](https://docs.victoriametrics.com/#how-to-scrape-prometheus-exporters-such-as-node-exporter) +after applying all the configured [relabeling stages](https://docs.victoriametrics.com/vmagent.html#relabeling). Stream aggregation ignores timestamps associated with the input [samples](https://docs.victoriametrics.com/keyConcepts.html#raw-samples). It expects that the ingested samples have timestamps close to the current time. @@ -389,7 +390,10 @@ Both input and output metric names can be modified if needed via relabeling acco ## Relabeling It is possible to apply [arbitrary relabeling](https://docs.victoriametrics.com/vmagent.html#relabeling) to input and output metrics -during stream aggregation via `input_relabel_configs` and `output_relabel_config` options in [stream aggregation config](#stream-aggregation-config). +during stream aggregation via `input_relabel_configs` and `output_relabel_configs` options in [stream aggregation config](#stream-aggregation-config). + +Relabeling rules inside `input_relabel_configs` are applied to samples matching the `match` filters. +Relabeling rules inside `output_relabel_configs` are applied to aggregated samples before sending them to the remote storage. For example, the following config removes the `:1m_sum_samples` suffix added [to the output metric name](#output-metric-names): @@ -402,9 +406,6 @@ For example, the following config removes the `:1m_sum_samples` suffix added [to regex: "(.+):.+" ``` -`input_relabel_configs` and `output_relabel_config` is applied at the very end, after `-remoteWrite.relabelConfig` -and scrape relabeling was applied. - ## Aggregation outputs The aggregations are calculated during the `interval` specified in the [config](#stream-aggregation-config) diff --git a/docs/vmagent.md b/docs/vmagent.md index 3a71b0695b..2c962288c5 100644 --- a/docs/vmagent.md +++ b/docs/vmagent.md @@ -514,13 +514,16 @@ with [additional enhancements](#relabeling-enhancements). The relabeling can be This relabeling can be debugged via `http://vmagent:8429/metric-relabel-debug` page. See [these docs](#relabel-debug) for details. * At the `-remoteWrite.urlRelabelConfig` files. This relabeling is used for modifying labels for metrics - and for dropping unneeded metrics before sending them to a particular `-remoteWrite.url`. + and for dropping unneeded metrics before sending them to the particular `-remoteWrite.url`. This relabeling can be debugged via `http://vmagent:8429/metric-relabel-debug` page. See [these docs](#relabel-debug) for details. All the files with relabeling configs can contain special placeholders in the form `%{ENV_VAR}`, which are replaced by the corresponding environment variable values. +[Streaming aggregation](https://docs.victoriametrics.com/stream-aggregation.html), if configured, +is pefrormed after applying all the relabeling stages mentioned above. + The following articles contain useful information about Prometheus relabeling: * [Cookbook for common relabeling tasks](https://docs.victoriametrics.com/relabeling.html)