Documentation ¶
Index ¶
- func AlarmName(alarmType, resourceName string) string
- func GenerateDashboards(dashboards []*Dashboard) (cf []byte, err error)
- func LambdaMetricFilterName(lambdaName, metricName string) string
- type Alarm
- func (alarm *Alarm) EvaluationPeriods(evalPeriods int) *Alarm
- func (alarm *Alarm) MaxMillisecondsThreshold(threshold float32, period int) *Alarm
- func (alarm *Alarm) MaxNoUnitsThreshold(threshold float32, period int) *Alarm
- func (alarm *Alarm) MaxSecondsThreshold(threshold float32, period int) *Alarm
- func (alarm *Alarm) Metric(namespace, metricName string, dimensions []MetricDimension) *Alarm
- func (alarm *Alarm) P95SecondsThreshold(threshold float32, period int) *Alarm
- func (alarm *Alarm) SumCountThreshold(threshold float32, period int) *Alarm
- func (alarm *Alarm) SumNoUnitsThreshold(threshold float32, period int) *Alarm
- type AlarmProperties
- type Dashboard
- type DashboardProperties
- type DynamoDBAlarm
- type JSONDispatcher
- type LambdaAlarm
- type LambdaMetricFilterAlarm
- type MetricDimension
- type RefString
- type SFNAlarm
- type SNSAlarm
- type SQSAlarm
- type SubString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDashboards ¶
func LambdaMetricFilterName ¶
Types ¶
type Alarm ¶
type Alarm struct { Resource string `json:"-"` // use '-' tag so field is not serialized Type string Properties AlarmProperties }
func GenerateAlarms ¶
GenerateAlarms will read the CF in yml files in the cfDir, and generate CF for CloudWatch alarms for the infrastructure. NOTE: this will not work for resources referenced with Refs, this code requires constant values.
func (*Alarm) EvaluationPeriods ¶
EvaluationPeriods configures alarm for specified evaluation periods
func (*Alarm) MaxMillisecondsThreshold ¶
MaxMillisecondsThreshold configures alarm for max-based threshold with Milliseconds units
func (*Alarm) MaxNoUnitsThreshold ¶
MaxNoUnitsThreshold configures alarm for max-based threshold with MB units
func (*Alarm) MaxSecondsThreshold ¶
MaxSecondsThreshold configures alarm for max-based threshold with Seconds units
func (*Alarm) Metric ¶
func (alarm *Alarm) Metric(namespace, metricName string, dimensions []MetricDimension) *Alarm
Metric configures alarm for basic metric
func (*Alarm) P95SecondsThreshold ¶ added in v1.2.0
P95SecondsThreshold configures alarm for p90 threshold with Seconds units
func (*Alarm) SumCountThreshold ¶
SumCountThreshold configures alarm for sum-based threshold with Count units
type AlarmProperties ¶
type AlarmProperties struct { AlarmName string AlarmDescription string `json:",omitempty"` AlarmActions []RefString `json:",omitempty"` TreatMissingData string `json:",omitempty"` Namespace string `json:",omitempty"` MetricName string Dimensions []MetricDimension `json:",omitempty"` ComparisonOperator string EvaluationPeriods int Period int Threshold float32 Unit string Statistic string `json:",omitempty"` ExtendedStatistic string `json:",omitempty"` }
see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html
type Dashboard ¶
type Dashboard struct { Type string Properties DashboardProperties }
func NewDashboard ¶
type DashboardProperties ¶
type DynamoDBAlarm ¶
type DynamoDBAlarm struct {
Alarm
}
func NewDynamoDBAlarm ¶
func NewDynamoDBAlarm(operation, alarmType, metricName, message string, resource map[string]interface{}) *DynamoDBAlarm
type JSONDispatcher ¶ added in v1.2.0
type LambdaAlarm ¶
type LambdaAlarm struct { Alarm // contains filtered or unexported fields }
func NewLambdaAlarm ¶
func NewLambdaAlarm(alarmType, metricName, message string, resource map[string]interface{}) *LambdaAlarm
type LambdaMetricFilterAlarm ¶
type LambdaMetricFilterAlarm struct {
LambdaAlarm
}
func NewLambdaMetricFilterAlarm ¶
func NewLambdaMetricFilterAlarm(alarmType, metricName, message string, resource map[string]interface{}) *LambdaMetricFilterAlarm
type MetricDimension ¶
type MetricDimension struct { Name string // Use only one of Value, ValueSub or ValueRef Value string // contains filtered or unexported fields }
func (*MetricDimension) MarshalJSON ¶
func (m *MetricDimension) MarshalJSON() ([]byte, error)