Skip to content

Add alert for target down #11745

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

Merged
merged 1 commit into from
Jul 29, 2022
Merged
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
3 changes: 2 additions & 1 deletion operations/observability/mixins/platform/mixin.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
* Licensed under the MIT License. See License-MIT.txt in the project root for license information.
*/

(import './dashboards.libsonnet')
(import './dashboards.libsonnet') +
(import './rules.libsonnet')
6 changes: 6 additions & 0 deletions operations/observability/mixins/platform/rules.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
* Licensed under the MIT License. See License-MIT.txt in the project root for license information.
*/

(import './rules/scrape.libsonnet')
29 changes: 29 additions & 0 deletions operations/observability/mixins/platform/rules/scrape.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright (c) 2022 Gitpod GmbH. All rights reserved.
* Licensed under the MIT License. See License-MIT.txt in the project root for license information.
*/

{
prometheusAlerts+:: {
groups+: [
{
name: 'prometheus-scraping-rules',
rules: [
{
alert: 'TargetDownOrFailedScrape',
labels: {
severity: 'warning',
team: 'platform',
},
'for': '10m',
annotations: {
summary: 'Prometheus failed to scrape {{ $labels.job }}',
description: 'Prometheus couldn\'t scrape {{ printf "%.4g" $value }}% of the {{ $labels.job }} targets. Components could be unnavailable or we have some scraping misconfiguration.',
},
expr: '100 * (count(up{container!="workspace"} == 0) BY (job) / count(up{container!="workspace"}) BY (job)) > 0',
},
],
},
],
},
}