fileconsumer

package
v0.114.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowHeaderMetadataParsing = featuregate.GlobalRegistry().MustRegister(
	"filelog.allowHeaderMetadataParsing",
	featuregate.StageBeta,
	featuregate.WithRegisterDescription("When enabled, allows usage of the `header` setting."),
	featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/18198"),
)

Functions

This section is empty.

Types

type Config

type Config struct {
	matcher.Criteria        `mapstructure:",squash"`
	attrs.Resolver          `mapstructure:",squash"`
	PollInterval            time.Duration   `mapstructure:"poll_interval,omitempty"`
	MaxConcurrentFiles      int             `mapstructure:"max_concurrent_files,omitempty"`
	MaxBatches              int             `mapstructure:"max_batches,omitempty"`
	StartAt                 string          `mapstructure:"start_at,omitempty"`
	FingerprintSize         helper.ByteSize `mapstructure:"fingerprint_size,omitempty"`
	MaxLogSize              helper.ByteSize `mapstructure:"max_log_size,omitempty"`
	Encoding                string          `mapstructure:"encoding,omitempty"`
	SplitConfig             split.Config    `mapstructure:"multiline,omitempty"`
	TrimConfig              trim.Config     `mapstructure:",squash,omitempty"`
	FlushPeriod             time.Duration   `mapstructure:"force_flush_period,omitempty"`
	Header                  *HeaderConfig   `mapstructure:"header,omitempty"`
	DeleteAfterRead         bool            `mapstructure:"delete_after_read,omitempty"`
	IncludeFileRecordNumber bool            `mapstructure:"include_file_record_number,omitempty"`
	Compression             string          `mapstructure:"compression,omitempty"`
	PollsToArchive          int             `mapstructure:"-"` // TODO: activate this config once archiving is set up
	AcquireFSLock           bool            `mapstructure:"acquire_fs_lock,omitempty"`
}

Config is the configuration of a file input operator

func NewConfig

func NewConfig() *Config

NewConfig creates a new input config with default values

func (Config) Build

func (c Config) Build(set component.TelemetrySettings, emit emit.Callback, opts ...Option) (*Manager, error)

func (Config) BuildWithSplitFunc added in v0.65.0

func (c Config) BuildWithSplitFunc(set component.TelemetrySettings, emit emit.Callback, splitFunc bufio.SplitFunc) (*Manager, error)

Deprecated [v0.97.0] Use Build and WithSplitFunc option instead

type HeaderConfig added in v0.73.0

type HeaderConfig struct {
	Pattern           string            `mapstructure:"pattern"`
	MetadataOperators []operator.Config `mapstructure:"metadata_operators"`
}

type Manager added in v0.57.2

type Manager struct {
	// contains filtered or unexported fields
}

func (*Manager) Start added in v0.57.2

func (m *Manager) Start(persister operator.Persister) error

func (*Manager) Stop added in v0.57.2

func (m *Manager) Stop() error

Stop will stop the file monitoring process

type Option added in v0.97.0

type Option func(*options)

func WithNoTracking added in v0.99.0

func WithNoTracking() Option

WithNoTracking forces the readerFactory to not keep track of files in memory. When used, the reader will read from the beginning of each file every time it is polled.

func WithSplitFunc added in v0.97.0

func WithSplitFunc(f bufio.SplitFunc) Option

WithSplitFunc overrides the split func which is normally built from other settings on the config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL