How telekom/sparrow works
Sparrow periodically runs configurable infrastructure and network checks, then exposes their results and Prometheus metrics through an HTTP API. The graph follows the documented workflow and sampled controller, loader, API, target-manager, and traceroute code; some wiring in the unsampled run and check implementations is necessarily represented only where the tree or README supports it.
Main entry points: controller.go Checks controller · sparrow/run.go Instance runtime · handlers.go API handlers · cmd/run.go Run command
Components 26
Startup and config
- Run command
cmd/run.go - Startup config
pkg/config/config.go - Config loaders
pkg/config/loader.go - File loader
pkg/config/file.go - HTTP loader
pkg/config/http.go
Runtime orchestration
- Checks config
pkg/checks/runtime/config.go - Instance runtime
pkg/sparrow/run.go - Checks controller
pkg/sparrow/controller.go - Check factory
pkg/factory/factory.go - Results store
pkg/db/db.go
Monitoring checks
- Health check
pkg/checks/health/health.go - Latency check
pkg/checks/latency/latency.go - DNS check
pkg/checks/dns/dns.go - Traceroute check
pkg/checks/traceroute/traceroute.go
API and telemetry
- HTTP API
pkg/api/api.go - API handlers
pkg/sparrow/handlers.go - Prometheus metrics
pkg/sparrow/metrics/exporter.go
Global targets
- Target manager
pkg/sparrow/targets/manager.go - Target interactor
pkg/sparrow/targets/interactor/config.go
Other components
- Operator
- Monitored endpoints
- Sparrow peers
- DNS service
- Network targets
- Metrics consumers
- GitLab
Connections 31
- Operator → Run command: starts
- Run command → Startup config: loads settings
- Run command → Instance runtime: starts instance
- Instance runtime → Config loaders: starts loader
- Config loaders → File loader: selects file
- Config loaders → HTTP loader: selects HTTP
- File loader → Checks config: loads YAML
- HTTP loader → Checks config: fetches YAML
- HTTP loader → Monitored endpoints: fetches config
- Instance runtime → Checks controller: reconciles checks
- Checks config → Checks controller: configures
- Checks controller → Check factory: creates checks
- Checks controller → Results store: stores results
- Checks controller → Prometheus metrics: registers collectors
- Health check → Monitored endpoints: checks HTTP
- Latency check → Sparrow peers: measures round trip
- DNS check → DNS service: resolves names
- Traceroute check → Network targets: traces route
- Health check → Checks controller: emits results
- Latency check → Checks controller: emits results
- DNS check → Checks controller: emits results
- Traceroute check → Checks controller: emits results
- Instance runtime → HTTP API: starts API
- HTTP API → API handlers: dispatches requests
- API handlers → Checks controller: gets check schemas
- API handlers → Results store: reads results
- API handlers → Prometheus metrics: serves metrics
- Prometheus metrics → Metrics consumers: exposes metrics
- Instance runtime → Target manager: starts manager
- Target manager → Target interactor: uses interactor
- Target interactor → GitLab: reads and writes targets