-
Notifications
You must be signed in to change notification settings - Fork 2
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
Sane Opsgenie alerting #487
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d2a41f
Sane Opsgenie alerting
f38a1da
Update component/vshn_alerting.jsonnet
wejdross 39a19c5
Update component/vshn_alerting.jsonnet
wejdross f8f1db3
ensure only guaranteed instances alert
a8eaf4c
further inprovements
4012871
further inprovements
9d2c5ae
further inprovements
cde33a2
linking runbook url
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
|
||
local inv = kap.inventory(); | ||
local params = inv.parameters.appcat; | ||
|
||
|
||
local genGenericAlertingRule(serviceName) = { | ||
apiVersion: 'monitoring.coreos.com/v1', | ||
kind: 'PrometheusRule', | ||
metadata: { | ||
name: 'vshn-' + std.asciiLower(serviceName) + '-sla', | ||
namespace: params.slos.namespace, | ||
labels: { | ||
syn_team: 'schedar', | ||
syn_component: 'appcat', | ||
syn: 'true', | ||
}, | ||
}, | ||
spec: { | ||
groups: [ | ||
{ | ||
name: 'appcat-' + std.asciiLower(serviceName) + '-sla-target', | ||
rules: [ | ||
{ | ||
alert: 'vshn-' + std.asciiLower(serviceName) + '-sla', | ||
// this query can be read as: if the rate of probes that are not successful is higher than 0.2 in the last 5 minutes and in the last minute, then alert | ||
// rate works on per second basis, so 0.2 means 20% of the probes are failing, which for 5 minutes is 1 minute and for 1 minute is 45 seconds | ||
expr: 'rate(appcat_probes_seconds_count{reason!="success", service="' + serviceName + '", ha="false", maintenance="false"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", service="' + serviceName + '", ha="false", maintenance="false"}[1m]) > 0.75', | ||
labels: { | ||
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end }}', | ||
runbook: 'https://kb.vshn.ch/app-catalog/how-tos/appcat/GuaranteedUptimeTarget.html', | ||
service: serviceName, | ||
severity: 'critical', | ||
syn: 'true', | ||
syn_team: 'schedar', | ||
syn_component: 'appcat', | ||
}, | ||
}, | ||
{ | ||
alert: 'vshn-' + std.asciiLower(serviceName) + '-sla-ha', | ||
// this query can be read as: if the rate of probes that are not successful is higher than 0.2 in the last 5 minutes and in the last minute, then alert | ||
// rate works on per second basis, so 0.2 means 20% of the probes are failing, which for 5 minutes is 1 minute and for 1 minute is 45 seconds | ||
expr: 'rate(appcat_probes_seconds_count{reason!="success", service="' + serviceName + '", ha="true"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", service="' + serviceName + '", ha="true"}[1m]) > 0.75', | ||
labels: { | ||
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end }}', | ||
runbook: 'https://kb.vshn.ch/app-catalog/how-tos/appcat/GuaranteedUptimeTarget.html', | ||
service: serviceName, | ||
severity: 'critical', | ||
syn: 'true', | ||
syn_team: 'schedar', | ||
syn_component: 'appcat', | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}; | ||
|
||
|
||
{ | ||
GenGenericAlertingRule: genGenericAlertingRule, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tests/golden/minio/appcat/appcat/sli_exporter/90_minio_Opsgenie.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
labels: | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar | ||
name: vshn-minio-sla | ||
namespace: appcat-slos | ||
spec: | ||
groups: | ||
- name: appcat-minio-sla-target | ||
rules: | ||
- alert: vshn-minio-sla | ||
expr: rate(appcat_probes_seconds_count{reason!="success", service="minio", | ||
ha="false", maintenance="false"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", | ||
service="minio", ha="false", maintenance="false"}[1m]) > 0.75 | ||
labels: | ||
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end | ||
}}' | ||
runbook: https://kb.vshn.ch/app-catalog/how-tos/appcat/GuaranteedUptimeTarget.html | ||
service: minio | ||
severity: critical | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar | ||
- alert: vshn-minio-sla-ha | ||
expr: rate(appcat_probes_seconds_count{reason!="success", service="minio", | ||
ha="true"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", | ||
service="minio", ha="true"}[1m]) > 0.75 | ||
labels: | ||
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end | ||
}}' | ||
runbook: https://kb.vshn.ch/app-catalog/how-tos/appcat/GuaranteedUptimeTarget.html | ||
service: minio | ||
severity: critical | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
tests/golden/openshift/appcat/appcat/sli_exporter/90_VSHNPostgreSQL_Opsgenie.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
labels: | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar | ||
name: vshn-vshnpostgresql-sla | ||
namespace: appcat-slos | ||
spec: | ||
groups: | ||
- name: appcat-vshnpostgresql-sla-target | ||
rules: | ||
- alert: vshn-vshnpostgresql-sla | ||
expr: rate(appcat_probes_seconds_count{reason!="success", service="VSHNPostgreSQL", | ||
ha="false", maintenance="false"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", | ||
service="VSHNPostgreSQL", ha="false", maintenance="false"}[1m]) > 0.75 | ||
labels: | ||
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end | ||
}}' | ||
runbook: https://kb.vshn.ch/app-catalog/how-tos/appcat/GuaranteedUptimeTarget.html | ||
service: VSHNPostgreSQL | ||
severity: critical | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar | ||
- alert: vshn-vshnpostgresql-sla-ha | ||
expr: rate(appcat_probes_seconds_count{reason!="success", service="VSHNPostgreSQL", | ||
ha="true"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", | ||
service="VSHNPostgreSQL", ha="true"}[1m]) > 0.75 | ||
labels: | ||
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end | ||
}}' | ||
runbook: https://kb.vshn.ch/app-catalog/how-tos/appcat/GuaranteedUptimeTarget.html | ||
service: VSHNPostgreSQL | ||
severity: critical | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar |
39 changes: 39 additions & 0 deletions
39
tests/golden/openshift/appcat/appcat/sli_exporter/90_VSHNRedis_Opsgenie.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
labels: | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar | ||
name: vshn-vshnredis-sla | ||
namespace: appcat-slos | ||
spec: | ||
groups: | ||
- name: appcat-vshnredis-sla-target | ||
rules: | ||
- alert: vshn-vshnredis-sla | ||
expr: rate(appcat_probes_seconds_count{reason!="success", service="VSHNRedis", | ||
ha="false", maintenance="false"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", | ||
service="VSHNRedis", ha="false", maintenance="false"}[1m]) > 0.75 | ||
labels: | ||
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end | ||
}}' | ||
runbook: https://kb.vshn.ch/app-catalog/how-tos/appcat/GuaranteedUptimeTarget.html | ||
service: VSHNRedis | ||
severity: critical | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar | ||
- alert: vshn-vshnredis-sla-ha | ||
expr: rate(appcat_probes_seconds_count{reason!="success", service="VSHNRedis", | ||
ha="true"}[5m]) > 0.2 and rate(appcat_probes_seconds_count{reason!="success", | ||
service="VSHNRedis", ha="true"}[1m]) > 0.75 | ||
labels: | ||
OnCall: '{{ if eq $labels.sla "guaranteed" }}true{{ else }}false{{ end | ||
}}' | ||
runbook: https://kb.vshn.ch/app-catalog/how-tos/appcat/GuaranteedUptimeTarget.html | ||
service: VSHNRedis | ||
severity: critical | ||
syn: 'true' | ||
syn_component: appcat | ||
syn_team: schedar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed the
syn: 'true'
label.