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

Add SLO alerts for rhobsp02ue1 #403

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 14 additions & 6 deletions observability/prometheusrules.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ local absent(name, job) = {
// Add dashboards and runbook anntotations.
// Overwrite severity to medium and high.
local appSREOverwrites(environment) = {
local dashboardDatasource = function(environment) {
local dashboardDatasource = function(name, environment) {
datasource:
if
environment == 'stage' then 'app-sre-stage-01-prometheus'
else if
environment == 'production' then 'telemeter-prod-01-prometheus'
!std.startsWith(name, 'rhobs-rhobsp02ue1') && environment == 'production' then 'telemeter-prod-01-prometheus'
else if
std.startsWith(name, 'rhobs-rhobsp02ue1') && environment == 'production' then 'rhobsp02ue1-prometheus'
else error 'no datasource for environment %s' % environment,
},

Expand Down Expand Up @@ -95,6 +97,8 @@ local appSREOverwrites(environment) = {
std.startsWith(name, 'rhobs-telemeter') && environment == 'stage' then '080e53f245a15445bdf777ae0e66945d'
else if
std.startsWith(name, 'rhobs-mst') && environment == 'production' then '283e7002d85c08126681241df2fdb22b'
else if
std.startsWith(name, 'rhobs-rhobsp02ue1') && environment == 'production' then '7f4df1c2d5518d5c3f2876ca9bb874a8'
else if
std.startsWith(name, 'rhobs-mst') && environment == 'stage' then '92520ea4d6976f30d1618164e186ef9b'
else if
Expand Down Expand Up @@ -154,15 +158,15 @@ local appSREOverwrites(environment) = {
runbook: 'https://github.com/rhobs/configuration/blob/main/docs/sop/observatorium.md#%s' % std.asciiLower(r.alert),
dashboard: 'https://grafana.app-sre.devshift.net/d/%s/api-logs?orgId=1&refresh=1m&var-datasource=%s&var-namespace={{$labels.namespace}}' % [
dashboardID('loki', environment).id,
dashboardDatasource(environment).datasource,
dashboardDatasource('loki', environment).datasource,
],
}
else if std.startsWith(g.name, 'telemeter') then
{
runbook: 'https://github.com/rhobs/configuration/blob/main/docs/sop/telemeter.md#%s' % std.asciiLower(r.alert),
dashboard: 'https://grafana.app-sre.devshift.net/d/%s/telemeter?orgId=1&refresh=1m&var-datasource=%s' % [
dashboardID(g.name, environment).id,
dashboardDatasource(environment).datasource,
dashboardDatasource(g.name, environment).datasource,
],
}
else if std.startsWith(g.name, 'loki_tenant') then
Expand All @@ -171,7 +175,7 @@ local appSREOverwrites(environment) = {
dashboard: 'https://grafana.app-sre.devshift.net/d/%s/%s?orgId=1&refresh=10s&var-metrics=%s&var-namespace={{$labels.namespace}}' % [
dashboardID(g.name, environment).id,
g.name,
dashboardDatasource(environment).datasource,
dashboardDatasource(g.name, environment).datasource,
],
}
else
Expand All @@ -180,7 +184,7 @@ local appSREOverwrites(environment) = {
dashboard: 'https://grafana.app-sre.devshift.net/d/%s/%s?orgId=1&refresh=10s&var-datasource=%s&var-namespace={{$labels.namespace}}&var-job=All&var-pod=All&var-interval=5m' % [
dashboardID(g.name, environment).id,
g.name,
dashboardDatasource(environment).datasource,
dashboardDatasource(g.name, environment).datasource,
],
},
labels: pruneUnsupportedLabels(r.labels {
Expand Down Expand Up @@ -471,6 +475,10 @@ local renderAlerts(name, environment, mixin) = {
'rhobs-slos-mst-stage.prometheusrules': renderAlerts('rhobs-slos-mst-stage', 'stage', flatten(mstStageSLOs)),
'rhobs-slos-mst-production.prometheusrules': renderAlerts('rhobs-slos-mst-production', 'production', flatten(mstProductionSLOs)),

local rhobsp02ue1ProductionSLOs = apiSLOs('rhobsp02ue1', 'observatorium-mst-production', 'observatorium-mst-production', 'observatorium-observatorium-mst-api').slos,

'rhobs-slos-rhobsp02ue1.prometheusrules': renderAlerts('rhobs-slos-rhobsp02ue1', 'production', flatten(rhobsp02ue1ProductionSLOs)),

local telemeterStageSLOs = telemeterServerSLOs + apiSLOs('telemeter', 'observatorium-stage', 'observatorium-metrics-stage', 'observatorium-observatorium-api').slos,
local telemeterProductionSLOs = telemeterServerSLOs + apiSLOs('telemeter', 'observatorium-production', 'observatorium-metrics-production', 'observatorium-observatorium-api').slos,

Expand Down
Loading