This documentation covers the production observability stack excluding frontend implementation details. It is written for three audiences:
- developers maintaining the Go backend, metric catalog, mock server, and infrastructure code
- operators deploying and running the stack on LAN and OCI hosts
- users who need to verify data, inspect dashboards, and understand the public API
- Architecture: system topology, trust boundaries, and data flow.
- Configuration: all environment variables, files, labels, and metric mappings.
- Deployment: production deployment checklist for OCI and LAN edge hosts.
- Operations: routine checks, upgrades, backups, and incident response.
- Troubleshooting: symptom-driven diagnosis.
- Backend: Go backend internals, cache behavior, query model, and limitations.
- API Reference: HTTP endpoints, parameters, responses, and error codes.
- Metrics Catalog: AirGradient scrape names, normalized API keys, labels, and validation queries.
- Grafana: datasource provisioning, dashboard contents, variables, and query maintenance.
- Security: public endpoint inventory, authentication, TLS, firewall, and production hardening.
- Development: non-frontend local development workflow and checks.
- Plan Alignment: implementation status and known follow-up work.
| Area | Path | Purpose |
|---|---|---|
| Edge collector | infra/edge/ |
vmagent Compose file and Prometheus scrape config |
| OCI stack | infra/oci/ |
Docker Compose, Caddy, Grafana provisioning |
| Backend API | app/backend/ |
Go service that queries VictoriaMetrics |
| Mock API | app/mock-server/ |
Generated API data for local development and demos |
| Dashboards | dashboards/ |
Grafana dashboard JSON |
| Scrape sample | app/backend/metrics |
Example AirGradient Prometheus exposition |
| Device JSON sample | app/backend/example.json |
Example AirGradient device JSON payload |
Production should satisfy these invariants:
- AirGradient is scraped only from the LAN.
vmagentis the only writer into VictoriaMetrics.- VictoriaMetrics is not exposed directly on the public internet.
- Caddy is the only public entry point on the OCI VM.
- public HTTP routes require TLS and Basic Auth.
- the backend is the only custom service that queries VictoriaMetrics for app data.
- Grafana uses the internal Docker-network VictoriaMetrics URL.
- metric names and labels are validated after every firmware or scrape-config change.
The repository includes app/frontend, but frontend implementation is intentionally excluded from this documentation pass. Where needed, docs mention the frontend only as a service behind Caddy or as a consumer of the backend API contract.