cloudwatch

package
v0.0.0-...-34898ab Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewCWClient = func(sess *session.Session) cloudwatchiface.CloudWatchAPI {
	client := cloudwatch.New(sess)
	client.Handlers.Send.PushFront(func(r *request.Request) {
		r.HTTPRequest.Header.Set("User-Agent", fmt.Sprintf("Grafarg/%s", setting.BuildVersion))
	})

	return client
}

NewCWClient is a CloudWatch client factory.

Stubbable by tests.

View Source
var NewCWLogsClient = func(sess *session.Session) cloudwatchlogsiface.CloudWatchLogsAPI {
	client := cloudwatchlogs.New(sess)
	client.Handlers.Send.PushFront(func(r *request.Request) {
		r.HTTPRequest.Header.Set("User-Agent", fmt.Sprintf("Grafarg/%s", setting.BuildVersion))
	})

	return client
}

NewCWLogsClient is a CloudWatch logs client factory.

Stubbable by tests.

Functions

This section is empty.

Types

type ByTime

type ByTime data.Frame

ByTime implements sort.Interface for data.Frame based on the frame's time field

func (ByTime) Len

func (a ByTime) Len() int

func (ByTime) Less

func (a ByTime) Less(i, j int) bool

func (ByTime) Swap

func (a ByTime) Swap(i, j int)

type CloudWatchService

type CloudWatchService struct {
	LogsService *LogsService `inject:""`
	Cfg         *setting.Cfg `inject:""`
	// contains filtered or unexported fields
}

func (*CloudWatchService) Init

func (s *CloudWatchService) Init() error

func (*CloudWatchService) NewExecutor

func (s *CloudWatchService) NewExecutor(*models.DataSource) (*cloudWatchExecutor, error)

type FakeCWClient

type FakeCWClient struct {
	cloudwatchiface.CloudWatchAPI

	Metrics []*cloudwatch.Metric

	MetricsPerPage int
}

func (FakeCWClient) ListMetricsPages

func (c FakeCWClient) ListMetricsPages(input *cloudwatch.ListMetricsInput, fn func(*cloudwatch.ListMetricsOutput, bool) bool) error

type FakeCWLogsClient

type FakeCWLogsClient struct {
	cloudwatchlogsiface.CloudWatchLogsAPI
	// contains filtered or unexported fields
}

func (FakeCWLogsClient) DescribeLogGroupsWithContext

func (FakeCWLogsClient) GetLogGroupFieldsWithContext

func (FakeCWLogsClient) GetQueryResultsWithContext

func (FakeCWLogsClient) StartQueryWithContext

func (FakeCWLogsClient) StopQueryWithContext

type LogQueryRunnerSupplier

type LogQueryRunnerSupplier struct {
	Publisher models.ChannelPublisher
	Service   *LogsService
}

func (*LogQueryRunnerSupplier) GetHandlerForPath

func (s *LogQueryRunnerSupplier) GetHandlerForPath(path string) (models.ChannelHandler, error)

GetHandlerForPath gets the channel handler for a certain path.

type LogsService

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

LogsService provides methods for querying CloudWatch Logs.

func (*LogsService) AddResponseChannel

func (s *LogsService) AddResponseChannel(name string, channel chan *tsdb.Response) error

func (*LogsService) DeleteResponseChannel

func (s *LogsService) DeleteResponseChannel(name string)

func (*LogsService) GetResponseChannel

func (s *LogsService) GetResponseChannel(name string) (chan *tsdb.Response, error)

func (*LogsService) Init

func (s *LogsService) Init() error

Init is called by the DI framework to initialize the instance.

type SessionCache

type SessionCache interface {
	GetSession(region string, s awsds.AWSDatasourceSettings) (*session.Session, error)
}

Jump to

Keyboard shortcuts

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