From e0fccc6c60f0009ad18e85dc6cd1db627b673ace Mon Sep 17 00:00:00 2001 From: Jiri Tyr Date: Tue, 25 Jun 2019 11:32:57 +0100 Subject: [PATCH] Change the default influxMeasurementFieldSeparator --- README.md | 6 ++---- app/vminsert/influx/request_handler.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4390cabad..1b6db3521 100644 --- a/README.md +++ b/README.md @@ -204,10 +204,8 @@ Do not forget substituting `` with the real address where VictoriaMetrics maps Influx data using the following rules: * [`db` query arg](https://docs.influxdata.com/influxdb/v1.7/tools/api/#write-http-endpoint) is mapped into `db` label value. -* Field names are mapped to time series names prefixed with `{measurement}{separator}` value. - `{separator}` equals to `.` by default, but can be changed with `-influxMeasurementFieldSeparator` command-line flag. - It is recommended setting it to `_` in order to be compatible with Prometheus, Promxy and `prometheus_client` plugin for Telegraf. - See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/79) for details. +* 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. * Field values are mapped to time series values. * Tags are mapped to Prometheus labels as-is. diff --git a/app/vminsert/influx/request_handler.go b/app/vminsert/influx/request_handler.go index c077ad652..7911e2124 100644 --- a/app/vminsert/influx/request_handler.go +++ b/app/vminsert/influx/request_handler.go @@ -18,7 +18,7 @@ import ( ) var ( - measurementFieldSeparator = flag.String("influxMeasurementFieldSeparator", ".", "Separator for `{measurement}{separator}{field_name}` metric name when inserted via Influx line protocol") + measurementFieldSeparator = flag.String("influxMeasurementFieldSeparator", "_", "Separator for `{measurement}{separator}{field_name}` metric name when inserted via Influx line protocol") skipSingleField = flag.Bool("influxSkipSingleField", false, "Uses `{measurement}` instead of `{measurement}{separator}{field_name}` for metic name if Influx line contains only a single field") )