diff --git a/app/vminsert/influx/request_handler.go b/app/vminsert/influx/request_handler.go index 38826fbe9..ac2a1056e 100644 --- a/app/vminsert/influx/request_handler.go +++ b/app/vminsert/influx/request_handler.go @@ -2,6 +2,7 @@ package influx import ( "compress/gzip" + "flag" "fmt" "io" "net/http" @@ -19,6 +20,10 @@ import ( "github.com/VictoriaMetrics/metrics" ) +var ( + measurementFieldSeparator = flag.String("influxMeasurementFieldSeparator", ".", "Separator for `{measurement}{separator}{field_name}` metric name when inserted via Influx line protocol") +) + var rowsInserted = tenantmetrics.NewCounterMap(`vm_rows_inserted_total{type="influx"}`) // InsertHandler processes remote write for influx line protocol. @@ -89,7 +94,7 @@ func (ctx *pushCtx) InsertRows(at *auth.Token, db string) error { ic.MetricNameBuf = storage.MarshalMetricNameRaw(ic.MetricNameBuf[:0], at.AccountID, at.ProjectID, ic.Labels) metricNameBufLen := len(ic.MetricNameBuf) ctx.metricGroupBuf = append(ctx.metricGroupBuf[:0], r.Measurement...) - ctx.metricGroupBuf = append(ctx.metricGroupBuf, '.') + ctx.metricGroupBuf = append(ctx.metricGroupBuf, *measurementFieldSeparator...) metricGroupPrefixLen := len(ctx.metricGroupBuf) ic.AddLabel("", "placeholder") placeholderLabel := &ic.Labels[len(ic.Labels)-1]