# shanmugapriya-st/slo-error-budget-demo architecture

> Architecture diagram of the GitHub repository shanmugapriya-st/slo-error-budget-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shanmugapriya-st/slo-error-budget-demo
- Repository: https://github.com/shanmugapriya-st/slo-error-budget-demo

## Overview

This is a small SLO/error-budget monitoring demo: generated traffic exercises a deliberately unreliable Flask service, Prometheus scrapes its metrics and evaluates burn-rate alerts, and Grafana presents reliability and latency signals. Its other major capability is deploying the stack to AWS with Terraform. The README documents the main runtime links; configuration details and Terraform internals were not sampled, so those relationships are shown only where documented.

Main entry points: [`prometheus/prometheus.yml`](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/prometheus/prometheus.yml) (Prometheus), [`app/load_gen.py`](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/app/load_gen.py) (Load generator), [`grafana/dashboards/slo-dashboard.json`](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/grafana/dashboards/slo-dashboard.json) (Grafana dashboard), [`terraform/main.tf`](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/terraform/main.tf) (AWS deployment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_traffic["Traffic generation"]
  node_loadgen["Load generator<br/>[load_gen.py]"]
end

subgraph group_service["Demo service"]
  node_flask["Flask service<br/>[app.py]"]
end

subgraph group_monitoring["Metrics and alerts"]
  node_prometheus["Prometheus<br/>[prometheus.yml]"]
  node_alert_rules["Burn-rate rules<br/>[alert_rules.yml]"]
end

subgraph group_deployment["Dashboards and deployment"]
  node_grafana["Grafana dashboard<br/>[slo-dashboard.json]"]
  node_grafana_provisioning["Grafana provisioning"]
  node_terraform["AWS deployment<br/>[main.tf]"]
end

node_operator(("Operator"))
node_aws["AWS EC2"]

node_operator -->|"starts traffic"| node_loadgen
node_loadgen -->|"sends requests"| node_flask
node_prometheus -->|"scrapes metrics"| node_flask
node_prometheus -->|"evaluates rules"| node_alert_rules
node_grafana -->|"queries metrics"| node_prometheus
node_grafana_provisioning -->|"provisions dashboard"| node_grafana
node_operator -->|"runs deployment"| node_terraform
node_terraform -->|"provisions instance"| node_aws

click node_loadgen "https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/app/load_gen.py"
click node_flask "https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/app/app.py"
click node_prometheus "https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/prometheus/prometheus.yml"
click node_alert_rules "https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/prometheus/alert_rules.yml"
click node_grafana "https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/grafana/dashboards/slo-dashboard.json"
click node_grafana_provisioning "https://github.com/shanmugapriya-st/slo-error-budget-demo/tree/main/grafana/provisioning"
click node_terraform "https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/terraform/main.tf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loadgen toneBlue
class node_flask toneAmber
class node_prometheus,node_alert_rules toneMint
class node_grafana,node_grafana_provisioning,node_terraform toneRose
class node_operator,node_aws toneIndigo
```

## Components

### Traffic generation

- [Load generator](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/app/load_gen.py): `app/load_gen.py`

### Demo service

- [Flask service](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/app/app.py): `app/app.py`

### Metrics and alerts

- [Prometheus](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/prometheus/prometheus.yml): `prometheus/prometheus.yml`
- [Burn-rate rules](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/prometheus/alert_rules.yml): `prometheus/alert_rules.yml`

### Dashboards and deployment

- [Grafana dashboard](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/grafana/dashboards/slo-dashboard.json): `grafana/dashboards/slo-dashboard.json`
- [Grafana provisioning](https://github.com/shanmugapriya-st/slo-error-budget-demo/tree/main/grafana/provisioning): `grafana/provisioning`
- [AWS deployment](https://github.com/shanmugapriya-st/slo-error-budget-demo/blob/main/terraform/main.tf): `terraform/main.tf`

### Other components

- **Operator**
- **AWS EC2**

## Connections

- Operator → Load generator: starts traffic (evidence: `README.md`)
- Load generator → Flask service: sends requests (evidence: `README.md`)
- Prometheus → Flask service: scrapes metrics (evidence: `README.md`)
- Prometheus → Burn-rate rules: evaluates rules (evidence: `README.md`)
- Grafana dashboard → Prometheus: queries metrics (evidence: `README.md`)
- Grafana provisioning → Grafana dashboard: provisions dashboard (evidence: `README.md`)
- Operator → AWS deployment: runs deployment (evidence: `README.md`)
- AWS deployment → AWS EC2: provisions instance (evidence: `README.md`)
