cloudwatch

package
v0.6.0-pre01 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrCode

func ErrCode(msg string, err error) error

Types

type Cloudwatch

type Cloudwatch struct {
	Service cloudwatchiface.CloudWatchAPI
}

Cloudwatch is a wrapper around the aws cloudwatch service with some default config info

func NewSession

func NewSession(account common.Account) Cloudwatch

NewSession creates a new cloudwatch session

func (*Cloudwatch) GetMetricWidget

func (c *Cloudwatch) GetMetricWidget(ctx context.Context, req MetricsRequest) ([]byte, error)

GetMetricWidget gets a metric widget image for an instance id https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Metric-Widget-Structure.html https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/viewing_metrics_with_cloudwatch.html https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch-metrics.html

Example metrics request

{
  "metrics": [
    [ "AWS/ECS", "CPUUtilization", "ClusterName", "spinup-000393", "ServiceName", "spinup-0010a3-testsvc" ]
  ],
  "stat": "Average"
  "period": 300,
  "start": "-P1D",
  "end": "PT0H"
}

type Metric

type Metric []string

type MetricsRequest added in v0.4.0

type MetricsRequest map[string]interface{}

Jump to

Keyboard shortcuts

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