From 9e50ea6cced8104ecea61220549dbeff80d9612a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 18 Sep 2023 11:59:46 +0200 Subject: [PATCH] app/vlinsert/insertutils: cosmetic changes after 8d3e574c31568553f03bbed06224601c47467eb4 --- app/vlinsert/insertutils/common_params.go | 5 ++--- app/vlinsert/insertutils/flags.go | 2 +- docs/VictoriaLogs/README.md | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/vlinsert/insertutils/common_params.go b/app/vlinsert/insertutils/common_params.go index a42cb3b1f9..23f100775d 100644 --- a/app/vlinsert/insertutils/common_params.go +++ b/app/vlinsert/insertutils/common_params.go @@ -75,9 +75,8 @@ func GetCommonParams(r *http.Request) (*CommonParams, error) { func (cp *CommonParams) GetProcessLogMessageFunc(lr *logstorage.LogRows) func(timestamp int64, fields []logstorage.Field) { return func(timestamp int64, fields []logstorage.Field) { if len(fields) > *MaxFieldsPerLine { - var rf logstorage.RowFormatter - rf = append(rf[:0], fields...) - logger.Warnf("dropping log line with %d fields; it exceeds -insert.maxFieldsPerLine=%d; %s", len(fields), *MaxFieldsPerLine, rf.String()) + rf := logstorage.RowFormatter(fields) + logger.Warnf("dropping log line with %d fields; it exceeds -insert.maxFieldsPerLine=%d; %s", len(fields), *MaxFieldsPerLine, rf) rowsDroppedTotalTooManyFields.Inc() return } diff --git a/app/vlinsert/insertutils/flags.go b/app/vlinsert/insertutils/flags.go index f1b28a88c3..403e315f21 100644 --- a/app/vlinsert/insertutils/flags.go +++ b/app/vlinsert/insertutils/flags.go @@ -11,5 +11,5 @@ var ( MaxLineSizeBytes = flagutil.NewBytes("insert.maxLineSizeBytes", 256*1024, "The maximum size of a single line, which can be read by /insert/* handlers") // MaxFieldsPerLine is the maximum number of fields per line for /insert/* handlers - MaxFieldsPerLine = flag.Int("insert.maxFieldsPerLine", 1000, "The maximum number of fields per line, which can be read by /insert/* handlers") + MaxFieldsPerLine = flag.Int("insert.maxFieldsPerLine", 1000, "The maximum number of log fields per line, which can be read by /insert/* handlers") ) diff --git a/docs/VictoriaLogs/README.md b/docs/VictoriaLogs/README.md index 0990d2e187..22c722cc1d 100644 --- a/docs/VictoriaLogs/README.md +++ b/docs/VictoriaLogs/README.md @@ -172,7 +172,7 @@ Pass `-help` to VictoriaLogs in order to see the list of supported command-line -inmemoryDataFlushInterval duration The interval for guaranteed saving of in-memory data to disk. The saved data survives unclean shutdowns such as OOM crash, hardware reset, SIGKILL, etc. Bigger intervals may help increase the lifetime of flash storage with limited write cycles (e.g. Raspberry PI). Smaller intervals increase disk IO load. Minimum supported value is 1s (default 5s) -insert.maxFieldsPerLine int - The maximum number of fields per line, which can be read by /insert/* handlers (default 1000) + The maximum number of log fields per line, which can be read by /insert/* handlers (default 1000) -insert.maxLineSizeBytes size The maximum size of a single line, which can be read by /insert/* handlers Supports the following optional suffixes for size values: KB, MB, GB, TB, KiB, MiB, GiB, TiB (default 262144)