How willbrid/easy-api-prom-sms-alert works
Easy-api-prom-sms-alert is a configurable Prometheus/Alertmanager webhook that turns incoming alerts into provider-specific HTTP POST requests for SMS or messaging services. Its main workflow is configuration loading, HTTP alert receipt, per-alert recipient/message resolution, request construction, and provider delivery (or simulation logging). The graph follows sampled wiring and README capabilities; provider-specific integrations are described as generic HTTP APIs, and unsampled implementation details are omitted.
Main entry points: app.go Application assembly · alert/alert.go Alert use case · alert/alert.go Provider request delivery · main.go Program entry
Components 20
Startup and configuration
- Program entry
cmd/main.go - Runtime flags
config/flag.go - Provider configuration
config/config.go
HTTP ingress
- Route registration
internal/handler/handler.go - Authentication middleware
internal/handler/middleware/middleware.go - HTTP handlers
internal/handler/httphandler/alertHandler.go
Alert processing
- Alert model
internal/domain/alert.go - Alert use case
internal/usecase/alert/alert.go - Alert extraction
internal/pkg/alerthelper/alerthelper.go - Recipient lookup
internal/pkg/recipienthelper/recipienthelper.go
Provider delivery
- Delivery service setup
internal/microservice/microservice.go - Provider request delivery
internal/microservice/alert/alert.go - Parameter factory
pkg/httpparam/factory.go - HTTP parameter encoding
pkg/httpparam/builder.go
Runtime infrastructure
- Application assembly
internal/app/app.go - HTTP server
pkg/httpserver/server.go - HTTP client
pkg/httpclient/client.go - Logging
pkg/logging/logger.go
Other components
- Prometheus / Alertmanager
- SMS / messaging API
Connections 23
- Prometheus / Alertmanager → HTTP handlers: posts alerts
README.md - Program entry → Runtime flags: loads flags
cmd/main.go - Program entry → Provider configuration: loads configuration
cmd/main.go - Program entry → Logging: initializes logger
cmd/main.go - Program entry → Application assembly: starts application
cmd/main.go - Application assembly → Provider configuration: uses settings
internal/app/app.go - Application assembly → Delivery service setup: constructs delivery
internal/app/app.go - Application assembly → HTTP server: starts server
internal/app/app.go - Application assembly → Route registration: initializes routes
internal/app/app.go - Application assembly → Alert use case: constructs use cases
internal/app/app.go - Route registration → Authentication middleware: registers authentication
internal/handler/handler.go - Route registration → HTTP handlers: registers routes
internal/handler/handler.go - HTTP handlers → Alert use case: submits alert
internal/handler/httphandler/alertHandler.go - HTTP handlers → Alert model: wraps alert data
internal/handler/httphandler/alertHandler.go - Alert use case → Alert extraction: extracts alert details
internal/usecase/alert/alert.go - Alert use case → Recipient lookup: resolves recipients
internal/usecase/alert/alert.go - Alert use case → Alert model: uses alert settings
internal/usecase/alert/alert.go - Alert use case → Provider request delivery: requests delivery
internal/usecase/alert/alert.go - Delivery service setup → Provider request delivery: creates service
internal/microservice/microservice.go - Provider request delivery → Parameter factory: builds parameters
internal/microservice/alert/alert.go - Provider request delivery → HTTP client: posts request
internal/microservice/alert/alert.go - Provider request delivery → SMS / messaging API: sends HTTP POST
README.md - Parameter factory → HTTP parameter encoding: creates encoder
pkg/httpparam/factory.go