aws

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchCloudwatchLogs

func FetchCloudwatchLogs(ctx context.Context, logGroupName, logStreamName string, nextForwardToken *string, interval time.Duration, client GetLogEventsApi) (outputList [][]types.OutputLogEvent, nextToken *string, err error)

FetchCloudwatchLogs reads the content of a log stream and returns a two dimensional slice of log events

func FetchCpuAndMemoryUsage

func FetchCpuAndMemoryUsage(ctx context.Context, name, clusterName string, client GetMetricDataApi) (memoryUtilized uint32, memoryReserved uint32, cpuUtilized uint32, cpuReserved uint32, err error)

FetchCpuAndMemoryUsage queries cloudwatch for ECS service metrics and returns the following metrics: - MemoryUtilized - MemoryReserved - CpuUtilized - CpuReserved

func FetchLogStreams

func FetchLogStreams(ctx context.Context, logGroupName string, containerName, taskArn *string, client DescribeLogStreamsApi) ([]types.LogStream, error)

FetchLogStreams reads available logstreams from the specified cloudwatch LogGroup and returns them as a slice. The list is filtered to only include streams for the specified container and ECS taskArn and only includes streams that have been written to during the last 30 minutes

func NewClient added in v0.3.0

func NewClient(useTracing bool) *cloudwatch.Client

func NewLogsClient added in v0.3.0

func NewLogsClient(useTracing bool) *cloudwatchlogs.Client

Types

type DescribeLogStreamsApi

type DescribeLogStreamsApi interface {
	DescribeLogStreams(ctx context.Context, input *cloudwatchlogs.DescribeLogStreamsInput, optionFns ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.DescribeLogStreamsOutput, error)
}

type GetLogEventsApi

type GetLogEventsApi interface {
	GetLogEvents(ctx context.Context, input *cloudwatchlogs.GetLogEventsInput, optionFns ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.GetLogEventsOutput, error)
}

type GetMetricDataApi

type GetMetricDataApi interface {
	GetMetricData(ctx context.Context, input *cloudwatch.GetMetricDataInput, optionFns ...func(*cloudwatch.Options)) (*cloudwatch.GetMetricDataOutput, error)
}

Jump to

Keyboard shortcuts

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