Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arguments ¶
type Arguments struct {
Targets []discovery.Target `alloy:"targets,attr"`
ForwardTo []loki.LogsReceiver `alloy:"forward_to,attr"`
Encoding string `alloy:"encoding,attr,optional"`
DecompressionConfig DecompressionConfig `alloy:"decompression,block,optional"`
FileWatch FileWatch `alloy:"file_watch,block,optional"`
FileMatch FileMatch `alloy:"file_match,block,optional"`
TailFromEnd bool `alloy:"tail_from_end,attr,optional"`
LegacyPositionsFile string `alloy:"legacy_positions_file,attr,optional"`
OnPositionsFileError OnPositionsFileError `alloy:"on_positions_file_error,attr,optional"`
}
Arguments holds values which are used to configure the loki.source.file component.
func (*Arguments) SetToDefault ¶
func (a *Arguments) SetToDefault()
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component implements the loki.source.file component.
func (*Component) DebugInfo ¶
DebugInfo returns information about the status of tailed targets. TODO(@tpaschalis) Decorate with more debug information once it's made available, such as the last time a log line was read.
func (*Component) IsStopping ¶ added in v1.7.0
type CompressionFormat ¶
type CompressionFormat string
func (CompressionFormat) MarshalText ¶
func (ut CompressionFormat) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler.
func (CompressionFormat) String ¶
func (ut CompressionFormat) String() string
func (*CompressionFormat) UnmarshalText ¶
func (ut *CompressionFormat) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type DecompressionConfig ¶
type DecompressionConfig struct {
Enabled bool `alloy:"enabled,attr"`
InitialDelay time.Duration `alloy:"initial_delay,attr,optional"`
Format CompressionFormat `alloy:"format,attr"`
}
type FileMatch ¶
type FileMatch struct {
Enabled bool `alloy:"enabled,attr,optional"`
SyncPeriod time.Duration `alloy:"sync_period,attr,optional"`
IgnoreOlderThan time.Duration `alloy:"ignore_older_than,attr,optional"`
}
func (*FileMatch) SetToDefault ¶
func (a *FileMatch) SetToDefault()
type FileWatch ¶
type FileWatch struct {
MinPollFrequency time.Duration `alloy:"min_poll_frequency,attr,optional"`
MaxPollFrequency time.Duration `alloy:"max_poll_frequency,attr,optional"`
}
func (*FileWatch) SetToDefault ¶
func (a *FileWatch) SetToDefault()
type OnPositionsFileError ¶
type OnPositionsFileError string
const ( OnPositionsFileErrorSkip OnPositionsFileError = "skip" OnPositionsFileErrorRestartEnd OnPositionsFileError = "restart_from_end" OnPositionsFileErrorRestartBeginning OnPositionsFileError = "restart_from_beginning" )
func (OnPositionsFileError) MarshalText ¶
func (o OnPositionsFileError) MarshalText() ([]byte, error)
func (*OnPositionsFileError) UnmarshalText ¶
func (o *OnPositionsFileError) UnmarshalText(text []byte) error
type Scheduler ¶
type Scheduler[K comparable] struct { // contains filtered or unexported fields }
Scheduler manages the lifecycle of sources. It is not safe for concurrent use: callers must ensure proper synchronization when accessing or modifying Scheduler and its sources from multiple goroutines.
func NewScheduler ¶
func NewScheduler[K comparable]() *Scheduler[K]
func (*Scheduler[K]) ScheduleSource ¶
ScheduleSource will register and run the provided source in a goroutine. If a source with the same key already exists it will do nothing.
func (*Scheduler[K]) Stop ¶
func (s *Scheduler[K]) Stop()
Stop will stop all running sources and wait for them to finish.
func (*Scheduler[K]) StopSource ¶
StopSource will unregister provided source and cancel it without waiting for it to stop.
type Source ¶
type Source[K comparable] interface { // Run should start the source. // It should run until there is no more work or context is canceled. Run(ctx context.Context) // Key is used to uniquely identify the source. Key() K // IsRunning reports if source is still running. IsRunning() bool }
type SourceWithRetry ¶
type SourceWithRetry[K comparable] struct { // contains filtered or unexported fields }
SourceWithRetry is used to wrap another source and apply retries when running.
func NewSourceWithRetry ¶
func NewSourceWithRetry[K comparable](source Source[K], config backoff.Config) *SourceWithRetry[K]
func (*SourceWithRetry[K]) IsRunning ¶
func (s *SourceWithRetry[K]) IsRunning() bool
func (*SourceWithRetry[K]) Key ¶
func (s *SourceWithRetry[K]) Key() K
func (*SourceWithRetry[K]) Run ¶
func (s *SourceWithRetry[K]) Run(ctx context.Context)