Interview Prep/Monitoring & Observability/Long-Term Storage, Scale and Cost

Leadership wants a yearly availability report per service, but year-long queries time out. What do you do?

IntermediateScenarioLong-Term Storage, Scale and Cost
Answer

Situation read → Raw request counters over a year is too much data per query.

What I'd do →

  1. Create recording rules for SLI ratios at coarse resolution:
    - record: service:sli_availability:ratio_rate1h
      expr: |
        sum by (service) (rate(http_requests_total{code!~"5.."}[1h]))
        / sum by (service) (rate(http_requests_total[1h]))
    
  2. Keep these series in long-term storage at full retention.
  3. Compute the yearly figure with avg_over_time(service:sli_availability:ratio_rate1h[365d]), or better, sum good and total counts separately and divide.
  4. Export monthly results to a table or warehouse for reporting.

Why → Pre-aggregation turns millions of series into one per service.

Interview tip → Note that averaging ratios is wrong when traffic varies; aggregate good/total events.

All Monitoring & Observability questions

More on Long-Term Storage, Scale and Cost