Documentation ¶
Index ¶
- func AlarmName(alarmType, resourceName string) string
- func GenerateDashboards(dashboards []*Dashboard) (cf []byte, err error)
- func GenerateMetrics(cfFiles ...string) ([]byte, error)
- func LambdaMetricFilterName(lambdaName, metricName string) string
- type APIGatewayAlarm
- 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) SumCountThreshold(threshold float32, period int) *Alarm
- func (alarm *Alarm) SumNoUnitsThreshold(threshold float32, period int) *Alarm
- type AlarmProperties
- type AppSyncAlarm
- type ApplicationELB
- type Dashboard
- type DashboardProperties
- type DynamoDBAlarm
- type LambdaAlarm
- type LambdaMetricFilterAlarm
- type MetricDimension
- type MetricFilter
- func NewGoLambdaErrorMetricFilter(lambdaName string) *MetricFilter
- func NewGoLambdaWarnMetricFilter(lambdaName string) *MetricFilter
- func NewLambdaMemoryMetricFilter(lambdaName string) *MetricFilter
- func NewLambdaMetricFilter(lambdaName, metricName, filterPattern, metricValue string) *MetricFilter
- func NewPythonLambdaErrorMetricFilter(lambdaName string) *MetricFilter
- func NewPythonLambdaWarnMetricFilter(lambdaName string) *MetricFilter
- type MetricFilterProperties
- type MetricTransformations
- type RefString
- type SNSAlarm
- type SQSAlarm
- type SubString
- type YamlDispatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDashboards ¶
func GenerateMetrics ¶
GenerateMetrics will read the CF in yml files in the cfDirs, and generate CF for CloudWatch metric filters for the infrastructure. NOTE: this will not work for resources referenced with Refs, this code requires constant values.
func LambdaMetricFilterName ¶
Types ¶
type APIGatewayAlarm ¶
type APIGatewayAlarm struct {
Alarm
}
func NewAPIGatewayAlarm ¶
func NewAPIGatewayAlarm(alarmType, metricName, message string, resource map[interface{}]interface{}) (alarm *APIGatewayAlarm)
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) 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 }
see: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html
type AppSyncAlarm ¶
type AppSyncAlarm struct {
Alarm
}
func NewAppSyncAlarm ¶
func NewAppSyncAlarm(alarmType, metricName, message string, resource map[interface{}]interface{}) (alarm *AppSyncAlarm)
type ApplicationELB ¶
type ApplicationELB struct {
Alarm
}
func NewApplicationELBAlarm ¶
func NewApplicationELBAlarm(alarmType, metricName, message string, resource map[interface{}]interface{}) *ApplicationELB
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[interface{}]interface{}) *DynamoDBAlarm
type LambdaAlarm ¶
type LambdaAlarm struct { Alarm // contains filtered or unexported fields }
func NewLambdaAlarm ¶
func NewLambdaAlarm(alarmType, metricName, message string, resource map[interface{}]interface{}) *LambdaAlarm
type LambdaMetricFilterAlarm ¶
type LambdaMetricFilterAlarm struct {
LambdaAlarm
}
func NewLambdaMetricFilterAlarm ¶
func NewLambdaMetricFilterAlarm(alarmType, metricName, message string, resource map[interface{}]interface{}) *LambdaMetricFilterAlarm
type MetricDimension ¶
type MetricDimension struct { Name string // Use only one of Value or ValueRef Value string // contains filtered or unexported fields }
func (*MetricDimension) MarshalJSON ¶
func (m *MetricDimension) MarshalJSON() ([]byte, error)
type MetricFilter ¶
type MetricFilter struct { Type string Properties MetricFilterProperties }
func NewGoLambdaErrorMetricFilter ¶
func NewGoLambdaErrorMetricFilter(lambdaName string) *MetricFilter
func NewGoLambdaWarnMetricFilter ¶
func NewGoLambdaWarnMetricFilter(lambdaName string) *MetricFilter
func NewLambdaMemoryMetricFilter ¶
func NewLambdaMemoryMetricFilter(lambdaName string) *MetricFilter
func NewLambdaMetricFilter ¶
func NewLambdaMetricFilter(lambdaName, metricName, filterPattern, metricValue string) *MetricFilter
func NewPythonLambdaErrorMetricFilter ¶
func NewPythonLambdaErrorMetricFilter(lambdaName string) *MetricFilter
func NewPythonLambdaWarnMetricFilter ¶
func NewPythonLambdaWarnMetricFilter(lambdaName string) *MetricFilter
type MetricFilterProperties ¶
type MetricFilterProperties struct { FilterPattern string LogGroupName string MetricTransformations []MetricTransformations }
type MetricTransformations ¶
type YamlDispatcher ¶
type YamlDispatcher func(resourceType string, resource map[interface{}]interface{})