Back to .md Directory

Aquaculture Platform - SLO/SLI Definitions

Defines seven SLO/SLI targets for an aquaculture platform, including error budget calculations, burn rate alerts, and metric dependencies enforced via Prometheus.

May 2, 2026
0 downloads
0 views
ai
View source

What this file does

Defines seven SLO/SLI targets for an aquaculture platform, including error budget calculations, burn rate alerts, and metric dependencies enforced via Prometheus.

When to use it

  • Setting up SLOs for a new microservice platform
  • Defining reliability contracts between platform and users
  • Configuring Prometheus alert rules with error budget burn rates
  • Establishing a quarterly SLO review and escalation policy

Assumes this stack

PrometheusPromQLGrafanaPagerDutyJira/Linear

Aquaculture Platform - SLO/SLI Definitions

Owner: Platform Team Effective Date: 2026-03-14 Review Cadence: Quarterly

Overview

This document defines the Service Level Objectives (SLOs) and Service Level Indicators (SLIs) for the Aquaculture Platform. These targets establish the reliability contract between the platform team and its users. All SLOs are enforced via Prometheus alert rules defined in infrastructure/monitoring/prometheus/alerts/slo-alerts.yml.


SLI / SLO Definitions

#SLIMeasurementSLO TargetWindowSeverity on Breach
1Gateway availabilityup{app="gateway-api"} ratio>= 99.9%30 days (rolling)critical
2API latency p95histogram_quantile(0.95, http_request_duration_seconds_bucket)< 500 ms30 days (rolling)warning
3API latency p99histogram_quantile(0.99, http_request_duration_seconds_bucket)< 2000 ms30 days (rolling)critical
4Error rate (5xx)rate(http_requests_total{status_code=~"5.."}[...]) / rate(http_requests_total[...])< 0.1%30 days (rolling)critical
5Sensor data freshnesstime() - max(sensor_reading_timestamp)< 60 s lag30 days (rolling)warning
6Login success raterate(auth_login_success_total) / rate(auth_login_attempts_total)>= 99.5%7 days (rolling)warning
7Webhook processing latencyhistogram_quantile(0.95, webhook_processing_duration_seconds_bucket)< 5 s30 days (rolling)warning

Error Budget

What is an error budget?

An error budget is the maximum amount of unreliability the platform can tolerate within a given window before corrective action is required.

Budget calculations (30-day window)

SLOError Budget (per 30 days)Equivalent
99.9% availability0.1% of 43,200 min = 43.2 minutes downtime~2.6 seconds/hour
99.5% login success (7d)0.5% of all login attempts over 7 daysVaries with traffic
< 0.1% error rateUp to 0.1% of all requests may be 5xxVaries with traffic

Burn rate alerts

Burn rate measures how fast the error budget is being consumed relative to the budget window. If the current error rate is constant and would exhaust the budget faster than expected, we trigger alerts at two thresholds:

AlertBurn RateWindowMeaning
SloErrorBudgetFastBurn14.4x1 hour (short) + 5 min (fast)Budget will exhaust in ~2 days at current rate. Page immediately.
SloErrorBudgetSlowBurn6x6 hours (short) + 30 min (fast)Budget will exhaust in ~5 days at current rate. Create ticket.

The multi-window approach (long + short window) reduces false positives by requiring sustained elevated error rates in both windows before firing.


Metric Dependencies

The following custom metrics must be exported by the respective services for these SLOs to be measurable:

MetricTypeExported ByLabels
http_request_duration_secondsHistogramAll HTTP services (via NestJS prom-client)method, route, status
http_requests_totalCounterAll HTTP servicesmethod, route, status_code
sensor_reading_timestampGaugesensor-servicesensor_type
auth_login_attempts_totalCounterauth-serviceresult (success/failure)
auth_login_success_totalCounterauth-service-
webhook_processing_duration_secondsHistogramgateway-api / alert-servicewebhook_type

Note: If a metric is not yet instrumented, the corresponding SLO alert will not fire (PromQL returns empty on missing series). Implementing these metrics is tracked in the platform backlog.


Escalation Policy

SeverityActionResponse TimeExample
criticalPage on-call engineer (PagerDuty)< 15 min acknowledgementGateway down, budget fast-burn
warningCreate ticket (Jira/Linear)< 4 hours triagep95 latency breach, slow-burn
infoDashboard visibility onlyNext business dayApproaching threshold

Review Process

  1. Weekly: Review error budget consumption in Grafana SLO dashboard.
  2. Monthly: Assess if SLO targets are appropriate given observed traffic patterns.
  3. Quarterly: Formal SLO review meeting. Adjust targets if needed. Update this document.
  4. Post-incident: If an SLO is breached, conduct a blameless postmortem and determine if the SLO target or alerting thresholds need adjustment.

Related Resources

  • Alert rules: infrastructure/monitoring/prometheus/alerts/slo-alerts.yml
  • Existing operational alerts: infrastructure/monitoring/prometheus/aquaculture-rules.yaml
  • Prometheus values: infrastructure/monitoring/prometheus/prometheus-values.yaml
  • Alertmanager routing: See alertmanager.config.route in prometheus-values.yaml

What's inside

7 SLO definitions, error budget table, 2 burn rate alerts, metric dependencies table, escalation policy, review process

Change this for your project

  • Replace infrastructure/monitoring/prometheus/alerts/slo-alerts.yml with your alert rules path
  • Replace sensor-service, auth-service, gateway-api with your service names
  • Replace Okan-wqm/aquaculture_platform with your repository name
  • Replace NestJS prom-client with your instrumentation library if different

Where it goes

Keep with your observability configuration. Describes what to track and alert on.

Worth borrowing

  • Multi-window burn rate alerts (long + short) to reduce false positives
  • Explicit metric dependency table to track instrumentation gaps
  • Quarterly review cadence with post-incident SLO adjustment

Related Documents