cloudwatchacquisition

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration added in v1.7.4

type Configuration struct {
	configuration.DataSourceCommonCfg `yaml:",inline"`
	GroupName                         string         `yaml:"group_name"`              // the group name to be monitored
	StreamRegexp                      *string        `yaml:"stream_regexp,omitempty"` // allow to filter specific streams
	StreamName                        *string        `yaml:"stream_name,omitempty"`
	StartTime, EndTime                *time.Time     `yaml:"-"`
	DescribeLogStreamsLimit           *int32         `yaml:"describelogstreams_limit,omitempty"` // batch size for DescribeLogStreamsPagesWithContext
	GetLogEventsPagesLimit            *int32         `yaml:"getlogeventspages_limit,omitempty"`
	PollNewStreamInterval             *time.Duration `yaml:"poll_new_stream_interval,omitempty"` // frequency at which we poll for new streams within the log group
	MaxStreamAge                      *time.Duration `yaml:"max_stream_age,omitempty"`           // monitor only streams that have been updated within $duration
	PollStreamInterval                *time.Duration `yaml:"poll_stream_interval,omitempty"`     // frequency at which we poll each stream
	StreamReadTimeout                 *time.Duration `yaml:"stream_read_timeout,omitempty"`      // stop monitoring streams that haven't been updated within $duration, might be reopened later tho
	AwsApiCallTimeout                 *time.Duration `yaml:"aws_api_timeout,omitempty"`
	AwsProfile                        *string        `yaml:"aws_profile,omitempty"`
	PrependCloudwatchTimestamp        *bool          `yaml:"prepend_cloudwatch_timestamp,omitempty"`
	AwsConfigDir                      *string        `yaml:"aws_config_dir,omitempty"`
	AwsRegion                         string         `yaml:"aws_region,omitempty"`
}

Configuration allows user to define one or more streams to monitor within a cloudwatch log group

type LogStreamTailConfig

type LogStreamTailConfig struct {
	GroupName                  string
	StreamName                 string
	GetLogEventsPagesLimit     int32
	PollStreamInterval         time.Duration
	StreamReadTimeout          time.Duration
	PrependCloudwatchTimestamp *bool
	Labels                     map[string]string

	ExpectMode int

	StartTime, EndTime time.Time // only used for CatMode
	// contains filtered or unexported fields
}

LogStreamTailConfig is the configuration for one given stream within one group

type Source added in v1.7.4

type Source struct {
	Config Configuration
	// contains filtered or unexported fields
}

Source is the runtime instance keeping track of N streams within 1 cloudwatch group

func (*Source) CanRun added in v1.7.4

func (*Source) CanRun() error

func (*Source) CatLogStream added in v1.7.4

func (s *Source) CatLogStream(ctx context.Context, cfg *LogStreamTailConfig, outChan chan pipeline.Event) error

func (*Source) Configure added in v1.7.4

func (s *Source) Configure(ctx context.Context, yamlConfig []byte, logger *log.Entry, metricsLevel metrics.AcquisitionMetricsLevel) error

func (*Source) ConfigureByDSN added in v1.7.4

func (s *Source) ConfigureByDSN(ctx context.Context, dsn string, labels map[string]string, logger *log.Entry, uuid string) error

func (*Source) Dump added in v1.7.4

func (s *Source) Dump() any

func (*Source) GetAggregMetrics added in v1.7.4

func (*Source) GetAggregMetrics() []prometheus.Collector

func (*Source) GetMetrics added in v1.7.4

func (*Source) GetMetrics() []prometheus.Collector

func (*Source) GetMode added in v1.7.4

func (s *Source) GetMode() string

func (*Source) GetName added in v1.7.4

func (*Source) GetName() string

func (*Source) GetUuid added in v1.7.4

func (s *Source) GetUuid() string

func (*Source) LogStreamManager added in v1.7.4

func (s *Source) LogStreamManager(ctx context.Context, in chan LogStreamTailConfig, outChan chan pipeline.Event) error

LogStreamManager receives the potential streams to monitor, and starts a go routine when needed

func (*Source) OneShotAcquisition added in v1.7.4

func (s *Source) OneShotAcquisition(ctx context.Context, out chan pipeline.Event, _ *tomb.Tomb) error

func (*Source) StreamingAcquisition added in v1.7.4

func (s *Source) StreamingAcquisition(ctx context.Context, out chan pipeline.Event, t *tomb.Tomb) error

func (*Source) TailLogStream added in v1.7.4

func (s *Source) TailLogStream(ctx context.Context, cfg *LogStreamTailConfig, outChan chan pipeline.Event) error

func (*Source) UnmarshalConfig added in v1.7.4

func (s *Source) UnmarshalConfig(yamlConfig []byte) error

func (*Source) WatchLogGroupForStreams added in v1.7.4

func (s *Source) WatchLogGroupForStreams(ctx context.Context, out chan LogStreamTailConfig) error

Jump to

Keyboard shortcuts

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