From 1c3f50f79185a170a4ec86e64b2180548d6072da Mon Sep 17 00:00:00 2001 From: Roman Khavronenko Date: Mon, 29 May 2023 08:37:23 +0300 Subject: [PATCH] docs: mention multi-tenancy in docs (#4357) The update should make understanding of multi-tenancy more clear for influxdb users. Signed-off-by: hagen1778 --- README.md | 6 ++++-- docs/README.md | 6 ++++-- docs/Single-server-VictoriaMetrics.md | 6 ++++-- docs/guides/migrate-from-influx.md | 8 +++++--- docs/keyConcepts.md | 20 ++++++++++++++++++++ 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cb7edbc8c..ecdf7ec7e 100644 --- a/README.md +++ b/README.md @@ -528,8 +528,10 @@ and stream plain InfluxDB line protocol data to the configured TCP and/or UDP ad VictoriaMetrics performs the following transformations to the ingested InfluxDB data: -* [db query arg](https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint) is mapped into `db` label value - unless `db` tag exists in the InfluxDB line. The `db` label name can be overridden via `-influxDBLabel` command-line flag. +* [db query arg](https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint) is mapped into `db` + [label](https://docs.victoriametrics.com/keyConcepts.html#labels) value unless `db` tag exists in the InfluxDB line. + The `db` label name can be overridden via `-influxDBLabel` command-line flag. If more strict data isolation is required, + read more about multi-tenancy [here](https://docs.victoriametrics.com/keyConcepts.html#multi-tenancy). * Field names are mapped to time series names prefixed with `{measurement}{separator}` value, where `{separator}` equals to `_` by default. It can be changed with `-influxMeasurementFieldSeparator` command-line flag. See also `-influxSkipSingleField` command-line flag. If `{measurement}` is empty or if `-influxSkipMeasurement` command-line flag is set, then time series names correspond to field names. * Field values are mapped to time series values. * Tags are mapped to Prometheus labels as-is. diff --git a/docs/README.md b/docs/README.md index fa75034ed..e6e1a1b78 100644 --- a/docs/README.md +++ b/docs/README.md @@ -531,8 +531,10 @@ and stream plain InfluxDB line protocol data to the configured TCP and/or UDP ad VictoriaMetrics performs the following transformations to the ingested InfluxDB data: -* [db query arg](https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint) is mapped into `db` label value - unless `db` tag exists in the InfluxDB line. The `db` label name can be overridden via `-influxDBLabel` command-line flag. +* [db query arg](https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint) is mapped into `db` + [label](https://docs.victoriametrics.com/keyConcepts.html#labels) value unless `db` tag exists in the InfluxDB line. + The `db` label name can be overridden via `-influxDBLabel` command-line flag. If more strict data isolation is required, + read more about multi-tenancy [here](https://docs.victoriametrics.com/keyConcepts.html#multi-tenancy). * Field names are mapped to time series names prefixed with `{measurement}{separator}` value, where `{separator}` equals to `_` by default. It can be changed with `-influxMeasurementFieldSeparator` command-line flag. See also `-influxSkipSingleField` command-line flag. If `{measurement}` is empty or if `-influxSkipMeasurement` command-line flag is set, then time series names correspond to field names. * Field values are mapped to time series values. * Tags are mapped to Prometheus labels as-is. diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index b082b886d..b5eb40b6d 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -539,8 +539,10 @@ and stream plain InfluxDB line protocol data to the configured TCP and/or UDP ad VictoriaMetrics performs the following transformations to the ingested InfluxDB data: -* [db query arg](https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint) is mapped into `db` label value - unless `db` tag exists in the InfluxDB line. The `db` label name can be overridden via `-influxDBLabel` command-line flag. +* [db query arg](https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint) is mapped into `db` + [label](https://docs.victoriametrics.com/keyConcepts.html#labels) value unless `db` tag exists in the InfluxDB line. + The `db` label name can be overridden via `-influxDBLabel` command-line flag. If more strict data isolation is required, + read more about multi-tenancy [here](https://docs.victoriametrics.com/keyConcepts.html#multi-tenancy). * Field names are mapped to time series names prefixed with `{measurement}{separator}` value, where `{separator}` equals to `_` by default. It can be changed with `-influxMeasurementFieldSeparator` command-line flag. See also `-influxSkipSingleField` command-line flag. If `{measurement}` is empty or if `-influxSkipMeasurement` command-line flag is set, then time series names correspond to field names. * Field values are mapped to time series values. * Tags are mapped to Prometheus labels as-is. diff --git a/docs/guides/migrate-from-influx.md b/docs/guides/migrate-from-influx.md index 21a52e982..ff7a0122a 100644 --- a/docs/guides/migrate-from-influx.md +++ b/docs/guides/migrate-from-influx.md @@ -45,10 +45,12 @@ with similarities and differences: or [fields](https://docs.influxdata.com/influxdb/v2.2/reference/key-concepts/data-elements/#field-key) in VictoriaMetrics, metric name contains it all. If measurement contains more than 1 field, then for VictoriaMetrics it will be multiple metrics; -* there are no [buckets](https://docs.influxdata.com/influxdb/v2.2/reference/key-concepts/data-elements/#bucket) - or [organizations](https://docs.influxdata.com/influxdb/v2.2/reference/key-concepts/data-elements/#organization), all +* there are no [databases](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#database), + [buckets](https://docs.influxdata.com/influxdb/v2.2/reference/key-concepts/data-elements/#bucket) + or [organizations](https://docs.influxdata.com/influxdb/v2.2/reference/key-concepts/data-elements/#organization). All data in VictoriaMetrics is stored in a global namespace or within - a [tenant](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy). + a [tenant](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy). + See more about multi-tenancy [here](https://docs.victoriametrics.com/keyConcepts.html#multi-tenancy). Let's consider the following [sample data](https://docs.influxdata.com/influxdb/v2.2/reference/key-concepts/data-elements/#sample-data) diff --git a/docs/keyConcepts.md b/docs/keyConcepts.md index 99b687d27..3b070abe1 100644 --- a/docs/keyConcepts.md +++ b/docs/keyConcepts.md @@ -34,6 +34,8 @@ You can be more specific here by saying `requests_success_total` (for only succe or `request_errors_total` (for requests which failed). Choosing a metric name is very important and supposed to clarify what is actually measured to every person who reads it, just like **variable names** in programming. +#### Labels + Every metric can contain additional meta-information in the form of label-value pairs: ``` @@ -53,6 +55,12 @@ requests_total{path="/", code="200"} {__name__="requests_total", path="/", code="200"} ``` +Labels can be automatically attached to the [time series](#time-series) +written via [vmagent](https://docs.victoriametrics.com/vmagent.html#adding-labels-to-metrics) +or [Prometheus](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#prometheus-setup). +VictoriaMetrics supports enforcing of label filters for [query API](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#prometheus-querying-api-enhancements) +to emulate data isolation. However, the real data isolation can be achieved via [multi-tenancy](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy). + #### Time series A combination of a metric name and its labels defines a `time series`. For example, @@ -344,6 +352,18 @@ It is very important to keep under control the number of unique label values, si leads to a new [time series](#time-series). Try to avoid using volatile label values such as session ID or query ID in order to avoid excessive resource usage and database slowdown. +### Multi-tenancy + +[Cluster version](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html) of VictoriaMetrics +supports [multi-tenancy](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#multitenancy) +for data isolation. + +Multi-tenancy can be emulated for [single-server](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html) +version of VictoriaMetrics by adding [labels](#labels) on [write path](#write-data) +and enforcing [labels filtering](https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html#prometheus-querying-api-enhancements) +on [read path](#query-data). + + ## Write data VictoriaMetrics supports both models used in modern monitoring applications: [push](#push-model) and [pull](#pull-model).