diff --git a/apps/k8s01/immich/kustomization.yaml b/apps/k8s01/immich/kustomization.yaml index 0ce62fbdffbd5546585f32a355d8925f2c41b4f0..9b88b77a566264293455aad1d643d00bbdbe2826 100644 --- a/apps/k8s01/immich/kustomization.yaml +++ b/apps/k8s01/immich/kustomization.yaml @@ -6,6 +6,7 @@ resources: - immich-values.yaml - certificate.yaml - limitrange.yaml + - slo.yaml - ../../../shared/resourcequotas/default.yaml patchesStrategicMerge: - database-override.yaml diff --git a/apps/k8s01/immich/slo.yaml b/apps/k8s01/immich/slo.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8e10c7dcf014a9e9431ee126f531949f86f09ee6 --- /dev/null +++ b/apps/k8s01/immich/slo.yaml @@ -0,0 +1,41 @@ +apiVersion: sloth.slok.dev/v1 +kind: PrometheusServiceLevel +metadata: + name: requests-immich + namespace: immich +spec: + service: "immich" + slos: + - name: "requests-availability" + objective: 98 + description: "Immich: SLO based on availability for HTTP request responses." + sli: + events: + errorQuery: sum(rate(nginx_ingress_controller_requests{exported_namespace="immich",ingress="immich",status=~"(5..|429)"}[{{.window}}])) + totalQuery: sum(rate(nginx_ingress_controller_requests{exported_namespace="immich",ingress="immich"}[{{.window}}])) > 0 OR vector(1) + alerting: + name: ImmichHighErrorRate + labels: + category: "availability" + annotations: + summary: "High error rate on 'immich' requests responses" + - name: "requests-latency" + objective: 95 + description: "Immich: SLO based on latency for HTTP request responses. Warns if requests take longer than 250ms. When responses are slower than 200ms they become noticable slow." + labels: + category: latency + sli: + events: + errorQuery: | + ( + sum(rate(nginx_ingress_controller_request_duration_seconds_count{exported_namespace="immich",ingress="immich",method!="WATCH"}[{{.window}}])) + - + sum(rate(nginx_ingress_controller_request_duration_seconds_bucket{exported_namespace="immich",ingress="immich",le="0.25",verb!="WATCH"}[{{.window}}])) + ) + totalQuery: sum(rate(nginx_ingress_controller_request_duration_seconds_count{exported_namespace="immich",ingress="immich",method!="WATCH"}[{{.window}}])) > 0 OR vector(1) + alerting: + name: ImmichLatencyAlert + labels: + category: "latency" + annotations: + summary: "Slow responses on 'immich' requests responses. More than 1% take more than 250ms." \ No newline at end of file