diff --git a/.werft/observability/monitoring-satellite.ts b/.werft/observability/monitoring-satellite.ts index 05ad3322232777..807accb43b15c6 100644 --- a/.werft/observability/monitoring-satellite.ts +++ b/.werft/observability/monitoring-satellite.ts @@ -114,7 +114,12 @@ export class MonitoringSatelliteInstaller { { "gitURL": "https://github.com/gitpod-io/observability", "path": "monitoring-satellite/manifests/probers", - }], + }, + { + "gitURL": "https://github.com/gitpod-io/gitpod", + "path": "operations/observability/mixins/IDE/rules", + }, + ], }, }' | go run main.go render --config - | kubectl --kubeconfig ${this.options.kubeconfigPath} apply -f -`; const renderingResult = exec(observabilityInstallerRenderCmd, { silent: false, dontCheckRc: true}); diff --git a/components/BUILD.yaml b/components/BUILD.yaml index 118f5380697567..7b411dce8034f6 100644 --- a/components/BUILD.yaml +++ b/components/BUILD.yaml @@ -16,7 +16,6 @@ packages: - install/preview:docker - install/kots:lint - components/gitpod-protocol:all - - operations/observability/mixins:lint - name: docker-versions type: docker config: diff --git a/operations/observability/mixins/BUILD.yaml b/operations/observability/mixins/BUILD.yaml deleted file mode 100644 index 7d6bcc6aeb3b85..00000000000000 --- a/operations/observability/mixins/BUILD.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) 2021 Gitpod GmbH. All rights reserved. -# Licensed under the GNU Affero General Public License (AGPL). -# See License-AGPL.txt in the project root for license information. - -packages: - - name: lint - type: generic - srcs: - - "**/*" - config: - commands: - - ["make", "promtool-lint"] - - ["make", "lint"] - - ["make", "unit-tests"] diff --git a/operations/observability/mixins/IDE/mixin.libsonnet b/operations/observability/mixins/IDE/mixin.libsonnet index 1ccff37afff3dc..154efffdea7505 100644 --- a/operations/observability/mixins/IDE/mixin.libsonnet +++ b/operations/observability/mixins/IDE/mixin.libsonnet @@ -3,5 +3,4 @@ * Licensed under the MIT License. See License-MIT.txt in the project root for license information. */ -(import './rules.libsonnet') + (import './dashboards.libsonnet') diff --git a/operations/observability/mixins/IDE/rules.libsonnet b/operations/observability/mixins/IDE/rules.libsonnet deleted file mode 100644 index 9c6e9658e094fd..00000000000000 --- a/operations/observability/mixins/IDE/rules.libsonnet +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2021 Gitpod GmbH. All rights reserved. - * Licensed under the MIT License. See License-MIT.txt in the project root for license information. - */ - -(import './rules/SLO/SLOs.libsonnet') + -(import './rules/components/components.libsonnet') diff --git a/operations/observability/mixins/IDE/rules/SLO/SLOs.libsonnet b/operations/observability/mixins/IDE/rules/SLO/SLOs.libsonnet deleted file mode 100644 index b6c118effbc3e5..00000000000000 --- a/operations/observability/mixins/IDE/rules/SLO/SLOs.libsonnet +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) 2021 Gitpod GmbH. All rights reserved. - * Licensed under the MIT License. See License-MIT.txt in the project root for license information. - */ - -{} diff --git a/operations/observability/mixins/IDE/rules/components/components.libsonnet b/operations/observability/mixins/IDE/rules/components/components.libsonnet deleted file mode 100644 index bfee198275ec86..00000000000000 --- a/operations/observability/mixins/IDE/rules/components/components.libsonnet +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2021 Gitpod GmbH. All rights reserved. - * Licensed under the MIT License. See License-MIT.txt in the project root for license information. - */ - -(import './openvsx-proxy/alerts.libsonnet') + -(import './openvsx-proxy/rules.libsonnet') diff --git a/operations/observability/mixins/IDE/rules/components/openvsx-proxy/alerts.libsonnet b/operations/observability/mixins/IDE/rules/components/openvsx-proxy/alerts.libsonnet deleted file mode 100644 index fea8c261993b76..00000000000000 --- a/operations/observability/mixins/IDE/rules/components/openvsx-proxy/alerts.libsonnet +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) 2021 Gitpod GmbH. All rights reserved. - * Licensed under the MIT License. See License-MIT.txt in the project root for license information. - */ - -{ - prometheusAlerts+:: { - groups+: [ - { - name: 'gitpod-component-openvsx-proxy-alerts', - rules: [ - { - alert: 'GitpodOpenVSXRegistryDown', - labels: { - severity: 'critical', - }, - 'for': '20m', - annotations: { - runbook_url: 'https://github.com/gitpod-io/runbooks/blob/main/runbooks/GitpodOpenVsxRegistryDown.md', - summary: 'Open-VSX registry is possibly down', - description: "Open-VSX registry is possibly down. We cannot pull VSCode extensions we don't have in our caches", - }, - expr: - ||| - sum(rate(gitpod_openvsx_proxy_requests_total{status=~"5..|error"}[5m])) / sum(rate(gitpod_openvsx_proxy_requests_total[5m])) > 0.01 - |||, - }, - { - alert: 'GitpodOpenVSXUnavailable', - labels: { - severity: 'warning', - team: 'ide', - }, - 'for': '10m', - annotations: { - summary: 'Prometheus is failing to scrape OpenVSX-proxy', - description: 'OpenVSX-proxy is possibly down, or prometheus is failing to scrape it.', - }, - expr: 'up{job="openvsx-proxy"} == 0', - }, - ], - }, - ], - }, -} diff --git a/operations/observability/mixins/IDE/rules/components/openvsx-proxy/rules.libsonnet b/operations/observability/mixins/IDE/rules/components/openvsx-proxy/rules.libsonnet deleted file mode 100644 index b1ab6e0b5b5e54..00000000000000 --- a/operations/observability/mixins/IDE/rules/components/openvsx-proxy/rules.libsonnet +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Copyright (c) 2021 Gitpod GmbH. All rights reserved. - * Licensed under the MIT License. See License-MIT.txt in the project root for license information. - */ - -{ - prometheusRules+:: { - groups+: [], - // There is no recording rules for this component. - }, -} diff --git a/operations/observability/mixins/IDE/rules/opensvx-proxy.yaml b/operations/observability/mixins/IDE/rules/opensvx-proxy.yaml new file mode 100644 index 00000000000000..c0527d7ebbea7f --- /dev/null +++ b/operations/observability/mixins/IDE/rules/opensvx-proxy.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2022 Gitpod GmbH. All rights reserved. +# Licensed under the GNU Affero General Public License (AGPL). +# See License-AGPL.txt in the project root for license information. + +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + labels: + prometheus: k8s + role: alert-rules + name: openvsx-proxy-monitoring-rules + namespace: monitoring-satellite +spec: + groups: + - name: openvsx-proxy + rules: + - alert: GitpodOpenVSXRegistryDown + labels: + severity: critical + for: 20m + annotations: + runbook_url: https://github.com/gitpod-io/runbooks/blob/main/runbooks/GitpodOpenVsxRegistryDown.md + summary: Open-VSX registry is possibly down + description: Open-VSX registry is possibly down. We cannot pull VSCode extensions we don't have in our caches + expr: | + sum(rate(gitpod_openvsx_proxy_requests_total{status=~"5..|error"}[5m])) / sum(rate(gitpod_openvsx_proxy_requests_total[5m])) > 0.01 + + - alert: GitpodOpenVSXUnavailable + labels: + severity: warning + team: ide + for: 10m + annotations: + summary: Prometheus is failing to scrape OpenVSX-proxy + description: OpenVSX-proxy is possibly down, or prometheus is failing to scrape it. + expr: up{job="openvsx-proxy"} == 0