Files
go-learning/exercises/03-ecosystems/03-sre-health-and-metrics/README.md
T

11 lines
555 B
Markdown

# 03 — SRE Observability (`/healthz`, `/readyz`, `log/slog`, Prometheus metrics)
## Zadania (`observability.go`)
1. `FormatPrometheusCounter(name, help string, value uint64) string` — wygeneruj poprawny tekst w formacie Prometheus exposition (`# HELP ...`, `# TYPE ... counter`, `<name> <value>\n`).
2. `ReadinessHandler(ready *atomic.Bool) http.HandlerFunc` — zwróć `200 OK` gdy `ready.Load()` jest `true`, inaczej `503 Service Unavailable`.
## Uruchomienie testów
```bash
make test PKG=./exercises/03-ecosystems/03-sre-health-and-metrics
```