Skip to content

Commit

Permalink
app/vlinsert/insertutils: cosmetic changes after 8d3e574
Browse files Browse the repository at this point in the history
  • Loading branch information
valyala committed Sep 18, 2023
1 parent 1870a5c commit 9e50ea6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/vlinsert/insertutils/common_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion app/vlinsert/insertutils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
2 changes: 1 addition & 1 deletion docs/VictoriaLogs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9e50ea6

Please sign in to comment.