How simpledotorg/rtsl_exporter works
RTSL Exporter is a Go Prometheus exporter that polls configured services and exposes their data at /metrics. The principal path is configuration and startup, metric collection by provider-specific exporters, outbound API requests, and Prometheus exposition. AlphaSMS and SendGrid are wired in main.go; DHIS2 collection is implemented but its startup wiring is not shown in the sampled entry point. Relationships below follow the excerpts and README; no unsampled wiring is assumed.
Main entry points: main.go Startup and registration · dhis2/exporter.go DHIS2 collector · alphasms/exporter.go AlphaSMS collector · sendgrid/exporter.go SendGrid collector
Components 14
Exporter runtime
- YAML configuration
main.go - Startup and registration
main.go - Metrics endpoint
main.go
Provider collectors
- AlphaSMS collector
alphasms/exporter.go - SendGrid collector
sendgrid/exporter.go - DHIS2 collector
dhis2/exporter.go
API clients
- AlphaSMS client
alphasms/client.go - SendGrid client
sendgrid/client.go - DHIS2 client
dhis2/client.go
Other components
- Operator
- Prometheus scraper
- AlphaSMS API
- SendGrid API
- DHIS2 API
Connections 13
- Operator → YAML configuration: supplies settings
README.md - YAML configuration → Startup and registration: configures
main.go - Startup and registration → AlphaSMS collector: registers
main.go - Startup and registration → SendGrid collector: registers
main.go - Startup and registration → Metrics endpoint: serves
main.go - Prometheus scraper → Metrics endpoint: scrapes
README.md - AlphaSMS collector → AlphaSMS client: requests balance
alphasms/exporter.go - AlphaSMS client → AlphaSMS API: fetches balance
alphasms/client.go - SendGrid collector → SendGrid client: fetches credits
sendgrid/exporter.go - SendGrid client → SendGrid API: requests credits
sendgrid/client.go - DHIS2 collector → DHIS2 client: requests system info
dhis2/exporter.go - DHIS2 client → DHIS2 API: fetches system info
dhis2/client.go - DHIS2 collector → Startup and registration: registration unshown