Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 5xx alarm #166

Merged
merged 6 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions terraform/monitoring/panels/lb/error_5xx.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,38 @@ local _configuration = defaults.configuration.timeseries
value = threshold,
)

.setAlert(
vars.environment,
grafana.alert.new(
namespace = vars.namespace,
name = "%(env)s - 5XX alert" % { env: grafana.utils.strings.capitalize(env) },
message = '%(env)s - Notify - 5XX alert' % { env: grafana.utils.strings.capitalize(env) },
notifications = vars.notifications,
noDataState = 'no_data',
period = '0m',
conditions = [
grafana.alertCondition.new(
evaluatorParams = [ 5 ],
evaluatorType = 'gt',
operatorType = 'or',
queryRefId = 'ELB',
queryTimeStart = '5m',
queryTimeEnd = 'now',
reducerType = grafana.alert_reducers.Avg
),
grafana.alertCondition.new(
evaluatorParams = [ threshold ],
evaluatorType = 'gt',
operatorType = 'or',
queryRefId = 'Target',
queryTimeStart = '5m',
queryTimeEnd = 'now',
reducerType = grafana.alert_reducers.Avg
),
],
)
)

.addTarget(targets.cloudwatch(
alias = 'ELB',
datasource = ds.cloudwatch,
Expand Down
Loading