Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // 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") )
Functions ¶
func CanWriteData ¶
func CanWriteData() error
CanWriteData returns non-nil error if data cannot be written to the underlying storage.
func MustStartIndexWorker ¶ added in v0.7.0
func MustStartIndexWorker()
MustStartIndexWorker starts a single goroutine indexWorker that reads from traceIDCh and write the index entry to storage.
func MustStopIndexWorker ¶ added in v0.7.0
func MustStopIndexWorker()
func SetLogRowsStorage ¶
func SetLogRowsStorage(storage LogRowsStorage)
SetLogRowsStorage sets the storage for writing data to via LogMessageProcessor.
This function must be called before using LogMessageProcessor and CanWriteData from this package.
Types ¶
type CommonParams ¶
type CommonParams struct {
TenantID logstorage.TenantID
TimeFields []string
MsgFields []string
StreamFields []string
IgnoreFields []string
DecolorizeFields []string
ExtraFields []logstorage.Field
IsTimeFieldSet bool
Debug bool
DebugRequestURI string
DebugRemoteAddr string
}
CommonParams contains common HTTP parameters used by log ingestion APIs.
See https://docs.victoriametrics.com/victorialogs/data-ingestion/#http-parameters
func GetCommonParams ¶
func GetCommonParams(r *http.Request) (*CommonParams, error)
GetCommonParams returns CommonParams from r.
func GetCommonParamsForSyslog ¶
func GetCommonParamsForSyslog(tenantID logstorage.TenantID, streamFields, ignoreFields, decolorizeFields []string, extraFields []logstorage.Field) *CommonParams
GetCommonParamsForSyslog returns common params needed for parsing syslog messages and storing them to the given tenantID.
func (*CommonParams) NewLogMessageProcessor ¶
func (cp *CommonParams) NewLogMessageProcessor(protocolName string, isStreamMode bool) LogMessageProcessor
NewLogMessageProcessor returns new LogMessageProcessor for the given cp.
MustClose() must be called on the returned LogMessageProcessor when it is no longer needed.
func (*CommonParams) NewTraceProcessor ¶ added in v0.7.0
func (cp *CommonParams) NewTraceProcessor(protocolName string, isStreamMode bool) LogMessageProcessor
NewTraceProcessor returns new TraceSpansProcessor for the given cp.
MustClose() must be called on the returned TraceSpansProcessor when it is no longer needed.
type InsertRowProcessor ¶
type InsertRowProcessor interface {
// AddInsertRow must add r to the underlying storage.
AddInsertRow(r *logstorage.InsertRow)
}
InsertRowProcessor is used by native data ingestion protocol parser.
type LogMessageProcessor ¶
type LogMessageProcessor interface {
// AddRow must add row to the LogMessageProcessor with the given timestamp and fields.
//
// If streamFieldsLen >= 0, then the given number of initial fields must be used as log stream fields instead of pre-configured fields.
//
// The LogMessageProcessor implementation cannot hold references to fields, since the caller can reuse them.
AddRow(timestamp int64, fields []logstorage.Field, streamFieldsLen int)
// MustClose() must flush all the remaining fields and free up resources occupied by LogMessageProcessor.
MustClose()
}
LogMessageProcessor is an interface for log message processors.
type LogRowsStorage ¶
type LogRowsStorage interface {
// MustAddRows must add lr to the underlying storage.
MustAddRows(lr *logstorage.LogRows)
// CanWriteData must returns non-nil error if logs cannot be added to the underlying storage.
CanWriteData() error
// IsLocalStorage tells the caller whether the current instance is using local storage.
IsLocalStorage() bool
}
LogRowsStorage is an interface for ingesting logs into the storage.