📡 sre-beacon
SRE Metrics Calculator & Reliability Analyzer
A Python CLI tool for Site Reliability Engineering — calculate SLO compliance, error budgets, availability nines, incident metrics (MTTR/MTTA/MTBF), toil estimation, Prometheus alert rule auditing, and SRE maturity assessment.
Features
| Command | What It Does |
|---|---|
sre-beacon slo |
Calculate SLO compliance and error budgets |
sre-beacon availability |
Calculate availability percentages and nines |
sre-beacon incidents |
Analyze incidents — MTTR, MTTA, MTBF |
sre-beacon toil |
Estimate toil hours and automation potential |
sre-beacon alerts |
Audit Prometheus/Alertmanager alert rules (15 rules) |
sre-beacon maturity |
Assess SRE maturity across 8 dimensions |
sre-beacon demo |
Run a full demo with sample data |
sre-beacon rules |
List all 15 alert audit rules |
Installation
git clone https://github.com/SanjaySundarMurthy/sre-beacon.git
cd sre-beacon
pip install -e .
Quick Start
# Run the full demo (creates sample data and runs all 6 analyses)
sre-beacon demo
# Run with verbose output
sre-beacon demo -v
Commands
SLO Compliance
sre-beacon slo slos.yaml actuals.yaml
sre-beacon slo slos.yaml actuals.yaml -v # detailed error budgets
sre-beacon slo slos.yaml actuals.yaml -f json -o report.json
slos.yaml:
slos:
- name: API Availability
service: api-gateway
sli_type: availability
target: 99.9
window_days: 30
actuals.yaml:
actuals:
- name: API Availability
value: 99.85
burn_rate: 1.5
Availability Calculator
sre-beacon availability services.yaml
sre-beacon availability services.yaml -v # nines comparison table
services.yaml:
services:
- name: api-gateway
total_minutes: 43200
downtime_minutes: 45
period: 30 days
Incident Analysis
sre-beacon incidents incidents.yaml
sre-beacon incidents incidents.yaml -v # per-service breakdown
sre-beacon incidents incidents.yaml -f json -o report.json
Toil Estimation
sre-beacon toil tasks.yaml
sre-beacon toil tasks.yaml -v # list all tasks
sre-beacon toil tasks.yaml --hours 200 # custom engineering hours
Alert Rule Audit
sre-beacon alerts alert-rules.yaml
sre-beacon alerts alert-rules.yaml -v # show all issues
sre-beacon alerts alert-rules.yaml --fail-on critical # CI/CD gate
sre-beacon alerts alert-rules.yaml -f json -o audit.json
SRE Maturity Assessment
sre-beacon maturity assessment.yaml
sre-beacon maturity assessment.yaml -v # findings & recommendations
Alert Audit Rules (15)
| Rule | Severity | Description |
|---|---|---|
| SRE-ALT-001 | HIGH | Alert without severity label |
| SRE-ALT-002 | HIGH | Alert without runbook_url annotation |
| SRE-ALT-003 | MEDIUM | Alert without description annotation |
| SRE-ALT-004 | HIGH | Alert without 'for' duration |
| SRE-ALT-005 | MEDIUM | Critical alert with excessive 'for' (>5m) |
| SRE-ALT-006 | LOW | Alert name doesn't follow CamelCase |
| SRE-ALT-007 | INFO | Complex expression (nested functions) |
| SRE-ALT-008 | MEDIUM | Alert without summary annotation |
| SRE-ALT-009 | MEDIUM | Duplicate alert name |
| SRE-ALT-010 | LOW | Alert without team/owner label |
| SRE-ALT-011 | HIGH | Warning alert configured to page |
| SRE-ALT-012 | CRITICAL | Alert expression is empty |
| SRE-ALT-013 | MEDIUM | Very short 'for' duration (<1m) |
| SRE-ALT-014 | LOW | Missing dashboard_url annotation |
| SRE-ALT-015 | INFO | Large alert group (>15 rules) |
Maturity Dimensions (8)
- SLO Adoption — SLO coverage, error budget tracking, review cadence
- Incident Management — Process, post-mortems, action items, detection
- Monitoring & Observability — Metrics, logging, tracing, golden signals
- Toil Reduction — Tracking, automation projects, self-service tools
- Blameless Culture — Post-mortems, learning reviews, psychological safety
- On-Call Practices — Rotation, compensation, runbooks, handoff
- Capacity Planning — Monitoring, projections, auto-scaling, load testing
- Change Management — CI/CD, canary deployments, rollback, feature flags
Export Formats
- Terminal — Rich formatted output (default)
- JSON — Machine-readable export
- HTML — Styled dark-theme report
CI/CD Integration
# GitHub Actions — fail on critical alert issues
- name: Audit Alert Rules
run: |
pip install sre-beacon
sre-beacon alerts ./monitoring/alert-rules.yaml --fail-on critical
Testing
python -m pytest tests/ -v
# 101 tests, all passing
Architecture
sre_beacon/
├── models.py # Core data models
├── calculators/
│ ├── slo_calculator.py # SLO compliance & error budgets
│ ├── availability_calculator.py # Availability & nines
│ ├── incident_calculator.py # MTTR, MTTA, MTBF
│ └── toil_calculator.py # Toil estimation
├── analyzers/
│ ├── alert_analyzer.py # 15 alert audit rules
│ └── maturity_analyzer.py # 8-dimension maturity scoring
├── reporters/
│ ├── terminal_reporter.py # Rich terminal output
│ └── export_reporter.py # JSON & HTML export
├── cli.py # Click CLI
└── demo.py # Demo data generator
License
MIT
Metadata
Release files for sre-beacon 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sre_beacon-1.0.0.tar.gz | 35.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sre_beacon-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 69.2 kB
Release files / sre_beacon-1.0.0.tar.gz
| Download URL | sre_beacon-1.0.0.tar.gz |
|---|---|
| Size | 35.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e26bd76fbd05435793f8250b9d95cfc08128f09ab05e3c0228f3895cf7d799fe
|
|
BLAKE2b-256 checksum How to use checksums |
fc23f944fc3bdd577356f17518c45bac9ff129f58498824aa851ec9205ebbeae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Release files / sre_beacon-1.0.0-py3-none-any.whl
| Download URL | sre_beacon-1.0.0-py3-none-any.whl |
|---|---|
| Size | 33.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d31e7db516968be298c5656b56b47c9eedc30dc8cc214a4981308a223f967fb1
|
|
BLAKE2b-256 checksum How to use checksums |
89ab614ae02b27a4f00142036cabc38abda5dcfedb75cf791a42438ab0d89806
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.7
|
Security for sre-beacon 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.