cloudwatch

package
v0.0.0-test Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: AGPL-3.0 Imports: 45 Imported by: 106

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LimitExceededException = "LimitExceededException"
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("Grafana/%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("Grafana/%s", setting.BuildVersion))
	})

	return client
}

NewCWLogsClient is a CloudWatch logs client factory.

Stubbable by tests.

Functions

func NewInstanceSettings

func NewInstanceSettings() datasource.InstanceFactoryFunc

Types

type AWSError

type AWSError struct {
	Code    string
	Message string
	Payload map[string]string
}

func (*AWSError) Error

func (e *AWSError) Error() string

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
	Cfg         *setting.Cfg
	Executor    *cloudWatchExecutor
}

func ProvideService

func ProvideService(cfg *setting.Cfg, logsService *LogsService, registrar plugins.CoreBackendRegistrar) (*CloudWatchService, error)

type FakeCWClient

type FakeCWClient struct {
	cloudwatchiface.CloudWatchAPI
	cloudwatch.GetMetricDataOutput

	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 ProvideLogsService

func ProvideLogsService() *LogsService

func (*LogsService) AddResponseChannel

func (s *LogsService) AddResponseChannel(name string, channel chan *backend.QueryDataResponse) error

func (*LogsService) DeleteResponseChannel

func (s *LogsService) DeleteResponseChannel(name string)

func (*LogsService) GetResponseChannel

func (s *LogsService) GetResponseChannel(name string) (chan *backend.QueryDataResponse, error)

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