Path: blob/main/operations/observability/mixins/workspace/rules/central/workspacefailure-SLO.yaml
2506 views
# Copyright (c) 2022 Gitpod GmbH. All rights reserved.1# Licensed under the GNU Affero General Public License (AGPL).2# See License.AGPL.txt in the project root for license information.34apiVersion: monitoring.coreos.com/v15kind: PrometheusRule6metadata:7labels:8prometheus: k8s9role: alert-rules10name: workspace-failure-slo-monitoring-rules11spec:12groups:13- name: workspace-failure-SLO14rules:15- record: gitpod_workspace_failure_total:5m_failure_ratio16expr: |17(18(19sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{reason="failed",type!~"Prebuild", cluster!~"ephemeral.*"}[5m]))20/21sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{type!~"Prebuild", cluster!~"ephemeral.*"}[5m]))22)23) + (24(25sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace",grpc_code!~"OK|ResourceExhausted", cluster!~"ephemeral.*"}[5m]))26/27sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace", cluster!~"ephemeral.*"}[5m]))28)29)3031- record: gitpod_workspace_failure_total:30m_failure_ratio32expr: |33(34(35sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{reason="failed",type!~"Prebuild", cluster!~"ephemeral.*"}[30m]))36/37sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{type!~"Prebuild", cluster!~"ephemeral.*"}[30m]))38)39) + (40(41sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace",grpc_code!~"OK|ResourceExhausted", cluster!~"ephemeral.*"}[30m]))42/43sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace", cluster!~"ephemeral.*"}[30m]))44)45)4647- record: gitpod_workspace_failure_total:1h_failure_ratio48expr: |49(50(51sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{reason="failed",type!~"Prebuild", cluster!~"ephemeral.*"}[1h]))52/53sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{type!~"Prebuild", cluster!~"ephemeral.*"}[1h]))54)55) + (56(57sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace",grpc_code!~"OK|ResourceExhausted", cluster!~"ephemeral.*"}[1h]))58/59sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace", cluster!~"ephemeral.*"}[1h]))60)61)6263- record: gitpod_workspace_failure_total:2h_failure_ratio64expr: |65(66(67sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{reason="failed",type!~"Prebuild", cluster!~"ephemeral.*"}[2h]))68/69sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{type!~"Prebuild", cluster!~"ephemeral.*"}[2h]))70)71) + (72(73sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace",grpc_code!~"OK|ResourceExhausted", cluster!~"ephemeral.*"}[2h]))74/75sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace", cluster!~"ephemeral.*"}[2h]))76)77)7879- record: gitpod_workspace_failure_total:6h_failure_ratio80expr: |81(82(83sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{reason="failed",type!~"Prebuild", cluster!~"ephemeral.*"}[6h]))84/85sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{type!~"Prebuild", cluster!~"ephemeral.*"}[6h]))86)87) + (88(89sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace",grpc_code!~"OK|ResourceExhausted", cluster!~"ephemeral.*"}[6h]))90/91sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace", cluster!~"ephemeral.*"}[6h]))92)93)9495- record: gitpod_workspace_failure_total:1d_failure_ratio96expr: |97(98(99sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{reason="failed",type!~"Prebuild", cluster!~"ephemeral.*"}[1d]))100/101sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{type!~"Prebuild", cluster!~"ephemeral.*"}[1d]))102)103) + (104(105sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace",grpc_code!~"OK|ResourceExhausted", cluster!~"ephemeral.*"}[1d]))106/107sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace", cluster!~"ephemeral.*"}[1d]))108)109)110111- record: gitpod_workspace_failure_total:3d_failure_ratio112expr: |113(114(115sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{reason="failed",type!~"Prebuild", cluster!~"ephemeral.*"}[3d]))116/117sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{type!~"Prebuild", cluster!~"ephemeral.*"}[3d]))118)119) + (120(121sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace",grpc_code!~"OK|ResourceExhausted", cluster!~"ephemeral.*"}[3d]))122/123sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace", cluster!~"ephemeral.*"}[3d]))124)125)126127- record: gitpod_workspace_failure_total:30d_failure_ratio128expr: |129(130(131sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{reason="failed",type!~"Prebuild", cluster!~"ephemeral.*"}[30d]))132/133sum(rate(gitpod_ws_manager_mk2_workspace_stops_total{type!~"Prebuild", cluster!~"ephemeral.*"}[30d]))134)135) + (136(137sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace",grpc_code!~"OK|ResourceExhausted", cluster!~"ephemeral.*"}[30d]))138/139sum(rate(grpc_server_handled_total{grpc_method="StartWorkspace", cluster!~"ephemeral.*"}[30d]))140)141)142143- record: gitpod_workspace_failure_total:slo_target144expr: "0.99"145- record: gitpod_workspace_failure_total:error_budget_remaining146expr: gitpod_workspace_failure_total:monthly_availability - gitpod_workspace_failure_total:slo_target147- record: gitpod_workspace_failure_total:monthly_availability148expr: 1 - gitpod_workspace_failure_total:30d_failure_ratio149150151