apiVersion: 1 groups: - orgId: 1 name: messenger-slo folder: Messenger interval: 30s rules: - uid: messenger-error-rate title: High business HTTP error rate condition: C for: 1m noDataState: OK execErrState: Error isPaused: false labels: severity: warning slo: api-availability annotations: summary: Business HTTP 5xx ratio is above 5%. description: "SLI = 5xx / all non-health requests. 4xx is not an error. SLO is 99% success over 5 minutes. The alert uses a 2 minute ratio and fires after 1 minute." runbook: high-error-rate.md data: - refId: A relativeTimeRange: from: 300 to: 0 datasourceUid: prometheus model: datasource: type: prometheus uid: prometheus editorMode: code expr: sum(rate(http_server_requests_milliseconds_count{status=~"5..",uri!~"/health.*"}[2m])) / clamp_min(sum(rate(http_server_requests_milliseconds_count{uri!~"/health.*"}[2m])), 1e-9) instant: true intervalMs: 1000 maxDataPoints: 43200 refId: A - refId: B relativeTimeRange: from: 300 to: 0 datasourceUid: __expr__ model: datasource: name: Expression type: __expr__ uid: __expr__ expression: A reducer: last refId: B type: reduce intervalMs: 1000 maxDataPoints: 43200 - refId: C relativeTimeRange: from: 300 to: 0 datasourceUid: __expr__ model: datasource: name: Expression type: __expr__ uid: __expr__ conditions: - evaluator: params: - 0.05 type: gt expression: B refId: C type: threshold intervalMs: 1000 maxDataPoints: 43200 - uid: messenger-queue-lag title: Attachment queue lag condition: C for: 30s noDataState: OK execErrState: Error isPaused: false labels: severity: warning slo: time-to-ready annotations: summary: Oldest queued attachment is older than 15 seconds. description: "Queue lag is the age of the oldest queued or processing attachment, in seconds. It is not worker duration. SLO is oldest age under 30s. The alert threshold is 15s for 30s." runbook: queue-lag.md data: - refId: A relativeTimeRange: from: 300 to: 0 datasourceUid: prometheus model: datasource: type: prometheus uid: prometheus editorMode: code expr: max(messenger_queue_oldest_age_seconds{queue="attachments.process"}) instant: true intervalMs: 1000 maxDataPoints: 43200 refId: A - refId: B relativeTimeRange: from: 300 to: 0 datasourceUid: __expr__ model: datasource: name: Expression type: __expr__ uid: __expr__ expression: A reducer: last refId: B type: reduce intervalMs: 1000 maxDataPoints: 43200 - refId: C relativeTimeRange: from: 300 to: 0 datasourceUid: __expr__ model: datasource: name: Expression type: __expr__ uid: __expr__ conditions: - evaluator: params: - 15 type: gt expression: B refId: C type: threshold intervalMs: 1000 maxDataPoints: 43200