collector

package
v0.0.0-...-fec136a Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSEC2Client

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

AWSEC2Client contains an AWS EC2 ec2iface client

func NewAWSEC2Client

func NewAWSEC2Client(awsRegion string) (*AWSEC2Client, error)

NewAWSEC2Client creates a new AWS EC2 API client

func (*AWSEC2Client) GetInstances

func (c *AWSEC2Client) GetInstances(ctx context.Context, tagFilter string) (*types.AWSEC2DescribeInstances, error)

GetInstances fetches all running instances using AWSEC2DescribeInstances

type AWSEC2InstanceGatherer

type AWSEC2InstanceGatherer interface {
	GetInstances(context.Context, string) (*types.AWSEC2DescribeInstances, error)
}

AWSEC2InstanceGatherer interface implments methods to gather AWS EC2 instance data

type AWSLogsClient

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

AWSLogsClient contains an AWS CloudWatch Logs cloudwatchlogsiface client

func NewAWSLogsClient

func NewAWSLogsClient(awsRegion string, logGroupNamePrefix *string) (*AWSLogsClient, error)

NewAWSLogsClient creates a new AWS CloudWatch Logs API client

func (*AWSLogsClient) GetLogGroups

func (c *AWSLogsClient) GetLogGroups(ctx context.Context) ([]*types.AWSLogGroup, error)

GetLogGroups returns all log groups under a perfix

func (*AWSLogsClient) GetLogStreams

func (c *AWSLogsClient) GetLogStreams(ctx context.Context, group *types.AWSLogGroup) (*types.AWSLogGroupStreams, error)

GetLogStreams will return all log streams for a group

type AWSLogsGatherer

type AWSLogsGatherer interface {
	GetLogGroups(context.Context) ([]*types.AWSLogGroup, error)
	GetLogStreams(ctx context.Context, group *types.AWSLogGroup) (*types.AWSLogGroupStreams, error)
}

AWSLogsGatherer interface implments methods to gather data on a AWS CloudWatch log group and its log streams

type Exporter

type Exporter struct {
	sync.Mutex // Our exporter object will be locakble to protect from concurrent scrapes
	// contains filtered or unexported fields
}

Exporter collects AWS Logs metrics

func New

func New(awsRegion string, logGroupPrefix string, logStreamTimeout time.Duration, ec2TagFilter string) (*Exporter, error)

New returns an initialized exporter

func (*Exporter) Collect

func (e *Exporter) Collect(ch chan<- prometheus.Metric)

Collect fetches the stats from configured AWS Logs and delivers them as Prometheus metrics. It implements prometheus.Collector

func (*Exporter) Describe

func (e *Exporter) Describe(ch chan<- *prometheus.Desc)

Describe describes all the metrics ever exported by the exporter. It implements prometheus.Collector.

type Instances

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

type LogGroups

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

Jump to

Keyboard shortcuts

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