cloudwatchacquisition

package
v1.4.2-rc5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudwatchSource

type CloudwatchSource struct {
	Config CloudwatchSourceConfiguration
	// contains filtered or unexported fields
}

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

func (*CloudwatchSource) CanRun

func (cw *CloudwatchSource) CanRun() error

func (*CloudwatchSource) CatLogStream

func (cw *CloudwatchSource) CatLogStream(cfg *LogStreamTailConfig, outChan chan types.Event) error

func (*CloudwatchSource) Configure

func (cw *CloudwatchSource) Configure(cfg []byte, logger *log.Entry) error

func (*CloudwatchSource) ConfigureByDSN

func (cw *CloudwatchSource) ConfigureByDSN(dsn string, labels map[string]string, logger *log.Entry) error

func (*CloudwatchSource) Dump

func (cw *CloudwatchSource) Dump() interface{}

func (*CloudwatchSource) GetAggregMetrics

func (cw *CloudwatchSource) GetAggregMetrics() []prometheus.Collector

func (*CloudwatchSource) GetMetrics

func (cw *CloudwatchSource) GetMetrics() []prometheus.Collector

func (*CloudwatchSource) GetMode

func (cw *CloudwatchSource) GetMode() string

func (*CloudwatchSource) GetName

func (cw *CloudwatchSource) GetName() string

func (*CloudwatchSource) LogStreamManager

func (cw *CloudwatchSource) LogStreamManager(in chan LogStreamTailConfig, outChan chan types.Event) error

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

func (*CloudwatchSource) OneShotAcquisition

func (cw *CloudwatchSource) OneShotAcquisition(out chan types.Event, t *tomb.Tomb) error

func (*CloudwatchSource) StreamingAcquisition

func (cw *CloudwatchSource) StreamingAcquisition(out chan types.Event, t *tomb.Tomb) error

func (*CloudwatchSource) TailLogStream

func (cw *CloudwatchSource) TailLogStream(cfg *LogStreamTailConfig, outChan chan types.Event) error

func (*CloudwatchSource) WatchLogGroupForStreams

func (cw *CloudwatchSource) WatchLogGroupForStreams(out chan LogStreamTailConfig) error

type CloudwatchSourceConfiguration

type CloudwatchSourceConfiguration 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           *int64         `yaml:"describelogstreams_limit,omitempty"` //batch size for DescribeLogStreamsPagesWithContext
	GetLogEventsPagesLimit            *int64         `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"`
}

CloudwatchSourceConfiguration 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     int64
	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

Jump to

Keyboard shortcuts

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