mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-06-30 22:23:49 +03:00
Previously too long field names were silently truncated. This is not what most users expect. It is better ignoring the whole log entry in this case and logging it with the WARNING message, so human operator could notice and fix the ingestion of incorrect logs ASAP. The commit also adds and updates the following entries to VictoriaLogs faq: - https://docs.victoriametrics.com/victorialogs/faq/#how-many-fields-a-single-log-entry-may-contain - https://docs.victoriametrics.com/victorialogs/faq/#what-is-the-maximum-supported-field-name-length - https://docs.victoriametrics.com/victorialogs/faq/#what-length-a-log-record-is-expected-to-have These entries are referred at `-insert.maxLineSizeBytes` and `-insert.maxFieldsPerLine` command-line descriptions and at the WARNING messages, which are emitted when log entries are ignored because of some of these limits are exceeded.
18 lines
795 B
Go
18 lines
795 B
Go
package insertutils
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/flagutil"
|
|
)
|
|
|
|
var (
|
|
// MaxLineSizeBytes is the maximum length of a single line for /insert/* handlers
|
|
MaxLineSizeBytes = flagutil.NewBytes("insert.maxLineSizeBytes", 256*1024, "The maximum size of a single line, which can be read by /insert/* handlers; "+
|
|
"see https://docs.victoriametrics.com/victorialogs/faq/#what-length-a-log-record-is-expected-to-have")
|
|
|
|
// MaxFieldsPerLine is the maximum number of fields per line for /insert/* handlers
|
|
MaxFieldsPerLine = flag.Int("insert.maxFieldsPerLine", 1000, "The maximum number of log fields per line, which can be read by /insert/* handlers; "+
|
|
"see https://docs.victoriametrics.com/victorialogs/faq/#how-many-fields-a-single-log-entry-may-contain")
|
|
)
|