Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 MetricsRequest ¶ added in v0.4.0
type MetricsRequest map[string]interface{}
Click to show internal directories.
Click to hide internal directories.