NthLayer - The Missing Layer of Reliability
Project description
NthLayer
Shift-left reliability for platform teams.
Define reliability requirements as code. Validate SLOs against dependency chains. Detect drift before incidents. Gate deployments on real data.
TL;DR
pip install nthlayer
⚠️ The Problem
Reliability decisions happen too late. Teams set SLOs in isolation, deploy without checking error budgets, and discover missing metrics during incidents. Dashboards are inconsistent. Alerts are copy-pasted. Nobody validates whether a 99.99% target is even achievable given dependencies.
💡 The Solution
NthLayer moves reliability left:
service.yaml → validate → check-deploy → deploy
│ │
│ └── Error budget ok? Drift acceptable?
│
└── SLO feasible? Dependencies support it? Metrics exist?
⚡ Core Features
Drift Detection
Predict SLO exhaustion before it happens. Don't wait for the budget to hit zero.
$ nthlayer drift payment-api
payment-api: CRITICAL
Current: 73.2% budget remaining
Trend: -2.1%/day (gradual decline)
Projection: Budget exhausts in 23 days
Recommendation: Investigate error rate increase before next release
Dependency-Aware SLO Validation
Your SLO ceiling is your weakest dependency chain. NthLayer calculates it.
$ nthlayer validate-slo payment-api
Target: 99.99% availability
Dependencies:
→ postgresql (99.95%)
→ redis (99.99%)
→ user-service (99.9%)
Serial availability: 99.84%
✗ INFEASIBLE: Target exceeds dependency ceiling by 0.15%
Recommendation: Reduce target to 99.8% or improve user-service SLO
Deployment Gates
Block deploys when error budget is exhausted or drift is critical.
$ nthlayer check-deploy payment-api
ERROR: Deployment blocked
- Error budget: -47 minutes (exhausted)
- Drift severity: critical
- 3 P1 incidents in last 7 days
Exit code: 2 (BLOCKED)
Blast Radius Analysis
Understand impact before making changes.
$ nthlayer blast-radius payment-api
Direct dependents (3):
• checkout-service (critical) - 847K req/day
• order-service (critical) - 523K req/day
• refund-worker (standard) - 12K req/day
Transitive impact: 12 services, 2.1M daily requests
Risk: HIGH - affects checkout flow
Metric Recommendations
Enforce OpenTelemetry conventions. Know what's missing before production.
$ nthlayer recommend-metrics payment-api
Required (SLO-critical):
✓ http.server.request.duration FOUND
✗ http.server.active_requests MISSING
Run with --show-code for instrumentation examples.
Artifact Generation
Generate dashboards, alerts, and SLOs from a single spec.
$ nthlayer apply service.yaml
Generated:
→ dashboard.json (Grafana)
→ alerts.yaml (Prometheus)
→ recording-rules.yaml (Prometheus)
→ slos.yaml (OpenSLO)
🚀 Quick Start
# Install
pip install nthlayer
# Create a service spec
nthlayer init
# Validate and generate
nthlayer apply service.yaml
# Check deployment readiness
nthlayer check-deploy payment-api
Minimal service.yaml
name: payment-api
tier: critical
type: api
team: payments
dependencies:
- postgresql
- redis
See full spec reference for all options.
🔄 CI/CD Integration
# GitHub Actions
- name: Validate reliability
run: |
nthlayer validate-slo ${{ matrix.service }}
nthlayer check-deploy ${{ matrix.service }}
Works with: GitHub Actions, GitLab CI, ArgoCD, Tekton, Jenkins
🎯 How It's Different
| Traditional Approach | NthLayer |
|---|---|
| Set SLOs in isolation | Validate against dependency chains |
| Alert when budget exhausted | Predict exhaustion with drift detection |
| Discover missing metrics in incidents | Enforce before deployment |
| Manual dashboard creation | Generate from spec |
| "Is this ready?" = opinion | "Is this ready?" = deterministic check |
📚 Documentation
Full Documentation - Comprehensive guides and reference.
| Guide | Description |
|---|---|
| Quick Start | Get running in 5 minutes |
| Drift Detection | Predict SLO exhaustion |
| Dependency Discovery | Automatic dependency mapping |
| CI/CD Integration | Pipeline setup |
| CLI Reference | All commands |
🗺️ Roadmap
- Artifact generation (dashboards, alerts, SLOs)
- Deployment gates (check-deploy)
- Error budget tracking
- Portfolio view
- Drift detection
- Dependency discovery
- validate-slo
- blast-radius
- Metric recommendations
- MCP server integration
- Backstage plugin
🤝 Contributing
# Install uv (https://docs.astral.sh/uv/)
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/rsionnach/nthlayer.git
cd nthlayer
make setup # Install deps, start services
make test # Run tests
See CONTRIBUTING.md for details.
📄 License
MIT - See LICENSE.txt
🙏 Acknowledgments
Built on grafana-foundation-sdk, awesome-prometheus-alerts, pint, and OpenSLO. Inspired by Sloth and autograf.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nthlayer-0.1.0a15.tar.gz.
File metadata
- Download URL: nthlayer-0.1.0a15.tar.gz
- Upload date:
- Size: 604.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a2f650d51aa8d5d981f9e6eda5ffcb784c38269e2dc1236bcc19251e97eeedc
|
|
| MD5 |
4b2838138b4547af8551087a3fab4c93
|
|
| BLAKE2b-256 |
76253bc51d3709d6865410578032e5160afbbf282e49c4d1b388dbc75e4c3504
|
Provenance
The following attestation bundles were made for nthlayer-0.1.0a15.tar.gz:
Publisher:
release.yml on rsionnach/nthlayer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nthlayer-0.1.0a15.tar.gz -
Subject digest:
3a2f650d51aa8d5d981f9e6eda5ffcb784c38269e2dc1236bcc19251e97eeedc - Sigstore transparency entry: 872347368
- Sigstore integration time:
-
Permalink:
rsionnach/nthlayer@334b9d47e997bb9efd2fb014568d6830084ab117 -
Branch / Tag:
refs/tags/v0.1.0a15 - Owner: https://github.com/rsionnach
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@334b9d47e997bb9efd2fb014568d6830084ab117 -
Trigger Event:
release
-
Statement type:
File details
Details for the file nthlayer-0.1.0a15-py3-none-any.whl.
File metadata
- Download URL: nthlayer-0.1.0a15-py3-none-any.whl
- Upload date:
- Size: 480.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62c8a46040516c4c88f4c2ceedcb262cde110ddf27fc0f12cac7d7786f39e0a6
|
|
| MD5 |
ee234e7eae8c6eff9bd62b2791678a09
|
|
| BLAKE2b-256 |
5b090e51cc2ddcd72c2de14c2e648039d0694abf5b6bc53f92ae1cc8994e8283
|
Provenance
The following attestation bundles were made for nthlayer-0.1.0a15-py3-none-any.whl:
Publisher:
release.yml on rsionnach/nthlayer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nthlayer-0.1.0a15-py3-none-any.whl -
Subject digest:
62c8a46040516c4c88f4c2ceedcb262cde110ddf27fc0f12cac7d7786f39e0a6 - Sigstore transparency entry: 872347371
- Sigstore integration time:
-
Permalink:
rsionnach/nthlayer@334b9d47e997bb9efd2fb014568d6830084ab117 -
Branch / Tag:
refs/tags/v0.1.0a15 - Owner: https://github.com/rsionnach
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@334b9d47e997bb9efd2fb014568d6830084ab117 -
Trigger Event:
release
-
Statement type: