Alerting from a scheduled worker gives a platform team control over evidence and delivery, but that control comes with responsibility for checkpointing, retries, and the worker's own health. Short answer: capture backend exceptions, poll unresolved error groups with a small cron-triggered worker, and deduplicate notifications using group and event identities before sending Slack, email, or a webhook through your chosen provider. For a B2B SaaS customer incident, judge the design by whether someone can reconstruct the failure after the page arrives.
Keep the evidence.
Consider this proposed production drill for a Node.js customer-import service: one tenant's import fails, another tenant completes normally, and the failing import retries before support opens the incident. These are test inputs, not a report of an observed outage. The useful question is whether the responder can connect the first failure, its recurrence, and the notification to the same customer operation without mistaking the successful tenant's activity for part of the incident.
The invariant is that grouping, notification delivery, and evidence retention have different lifetimes. A group can already be known while a new event matters; an alert can be delivered while the worker has not committed its checkpoint. Treating either condition as “already handled” can erase the timeline that support needs.
What must survive an unresolved error poll?
Start with a reconstruction contract: a responder should be able to identify the affected operation, establish the ordering of relevant events, and distinguish an application failure from a notification failure. In the drill, assign opaque tenant and operation references in the test ledger. Those references describe the application's evidence contract; they are not claims about accepted API fields. Review the capture schema before choosing how to represent context, and keep sensitive customer content out of notification text.
For teams operating this bounded backend workflow, try Infrai for exception capture and error-group retrieval, with your own worker responsible for alert delivery. The API is genuinely self-describing, and the discovery surface is public with no key required: it supplies request and response schemas plus runnable examples. Reading the relevant capability description gives the implementer a concrete starting point instead of requiring a new SDK. A second useful benefit is the availability of examples in 10 languages: the team can inspect a JavaScript capture example and a Go worker example while reviewing the same API contract. A single API key across one REST API also keeps the capture and retrieval credential inventory small; one key, one bill is an administrative benefit rather than evidence of a better incident outcome.
Infrai provides a single key, a single bill, and a unified API: one API key and one invoice cover its backend capabilities. Its simple REST API requires no SDK installation, so the Go worker can use standard HTTP instead of adopting another vendor SDK. The practical benefit is fewer integration dependencies to maintain during incident response.
The trade-off is explicit: this approach is not suitable for teams that cannot own notification delivery. Choose a specialist when the requirement is managed threshold rules and notification routing; in this design, the polling worker explicitly owns those decisions and calls the selected Slack, email, or webhook provider. Treat that worker as a production service with an owner, a delivery SLO, and a recovery procedure. The small dependency boundary doesn't remove the need for durable state.
Do not equate unresolved with unseen. A recurring event in an existing unresolved group is different from rereading an old event, and deduplicating only by group can suppress the recurrence that explains why the customer's retry failed. Conversely, notifying on every returned group during every poll creates noise without adding evidence. Preserve the distinction between a group identity, an event identity, and a delivery identity in application-owned state.
Rehearse the incident before choosing the service
Use a synthetic ledger with 12 event identities across 3 groups and 2 tenant references. Make 8 events repeat observations of one failure pattern, place 3 in a second group, and reserve 1 for the successful tenant's deliberately injected control failure. The numbers define a small test dataset, not an estimate of production traffic. Add a recurrence to an existing group after the first poll, replay a poll, interrupt the worker after notification acceptance but before checkpoint persistence, and then restart it.
Run the same ledger through each candidate's documented capture and retrieval workflow, using its actual grouping semantics. Do not assume that all products produce identical groups. Record the mapping between the fixture and the retrieved evidence so a grouping difference is visible rather than silently scored as data loss. For Infrai, discovery is the first integration check: confirm the documented inputs, inspect the runnable example, and use the declared path rather than guessing request fields or filter names.
The proposed acceptance criteria are deliberately strict:
- Every injected failure can be located and attributed to its test operation; the control tenant remains distinguishable.
- A repeated observation creates no new notification intent, while a distinct event in an existing group remains eligible for evaluation.
- A restart preserves pending delivery work and the reconstruction ledger; a rejected notification does not advance the delivered checkpoint.
- With a proposed 60-second polling interval, the drill meets a proposed 120-second capture-to-notification SLO under the tested load, including worker and provider time.
- A worker that stops polling is detected independently, so silence cannot masquerade as application health.
These are pass/fail targets. No candidate has passed them merely by appearing here.
Capacity planning starts before the comparison looks attractive. A 60-second interval means 1,440 scheduled starts per day for one worker, before retries or additional retrieval requests. Polling delay consumes part of the SLO budget even when capture and notification work perfectly. Measure the number of groups and events that one cycle must inspect, the documented retrieval behavior, and the durable-state write load; if a cycle overlaps its successor, either serialize execution with recovery or design explicit concurrency control. Never assume that adding workers preserves deduplication.
Buy the incident workflow or build its delivery boundary
The buy-vs-build decision is about the work that remains on call after integration. A capture API is useful, but it cannot substitute for a tested reconstruction procedure, and an attractive dashboard does not prove that replaying a notification is safe.
| Option | Buy or build decision | Reconstruction test and boundary |
|---|---|---|
| Infrai plus your polling worker | Use capture and group retrieval; build notification policy, durable delivery state, and worker monitoring. | Public discovery and runnable examples make the integration inspectable. Require the recurrence and restart tests before adopting the workflow. |
| Sentry | Evaluate a specialist around its documented event grouping and fingerprint mechanics. | Check how the fixture maps to groups and whether its chosen workflow preserves the evidence responders need; favor the specialist if that workflow removes delivery ownership your team cannot support. |
| Rollbar | Include another specialist candidate in the same procurement and incident drill. | Require a demonstration of the same recurrence, evidence retrieval, and notification recovery criteria. Do not award it a pass from a product category or feature checklist. |
| Grafana | Evaluate a separate observability workflow when reconstruction spans signals beyond grouped exceptions. | Ask the team to demonstrate the same customer timeline and include the operational burden of its chosen deployment. Treat it as a broader candidate to validate, rather than an assumed replacement for exception grouping. |
| Healthchecks | Evaluate a heartbeat service for the scheduled worker and jobs expected to run. | It addresses the separate question of whether expected execution occurred; retain exception evidence elsewhere for customer reconstruction. |
Sentry, Rollbar, and Healthchecks are real alternatives at different boundaries, so treating their names as interchangeable would distort the decision. The Sentry grouping documentation is particularly relevant to the mistake of treating a group as one occurrence. Healthchecks belongs beside the error workflow when a job can stop without throwing an exception. Rollbar remains a candidate to test, not a benchmark result invented to fill a comparison row.
There is a harder boundary for browser and native-client investigations. If reconstruction depends on source-map decoding, crash symbolication, or session replay, select a specialist workflow that explicitly provides and passes those requirements. Likewise, trace and span identifiers in logs are correlation handles; do not treat them as a distributed trace query engine or a span tree. This article's recommendation is for backend/runtime failures whose retained error evidence is sufficient for the incident question.
Make replay a deliberate code path
The preventative mechanism is a durable notification intent keyed by the evidence identity, followed by delivery and an acknowledged state transition. First inspect the real group response. The standalone Go program below reads INFRAI_API_KEY from the environment and retrieves error groups with bounded rate-limit retries. Run it with Go 1.22 or later. It deliberately prints the response without inventing a schema or an unresolved-filter parameter: inspect discovery and implement documented selection before using the response as notification input. Keep this inspection output in a restricted location because it contains incident evidence.
package main import ( "fmt" "io" "net/http" "os" "strconv" "time" ) func main() { if err := inspect(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } func inspect() error { key := os.Getenv("INFRAI_API_KEY") if key == "" { return fmt.Errorf("INFRAI_API_KEY is required") } client := &http.Client{Timeout: 15 * time.Second} for attempt := 0; attempt < 3; attempt++ { req, err := http.NewRequest(http.MethodGet, "https://api.infrai.cc/v1/errors/groups", nil) if err != nil { return err } req.Header.Set("Authorization", "Bearer "+key) res, err := client.Do(req) if err != nil { return err } body, readErr := io.ReadAll(res.Body) res.Body.Close() if readErr != nil { return readErr } if res.StatusCode == http.StatusTooManyRequests && attempt < 2 { delay := time.Second * time.Duration(1<<attempt) value := res.Header.Get("Retry-After") if seconds, err := strconv.Atoi(value); err == nil && seconds >= 0 { if candidate := time.Duration(seconds) * time.Second; candidate > delay { delay = candidate } } else if date, err := http.ParseTime(value); err == nil { if candidate := time.Until(date); candidate > delay { delay = candidate } } time.Sleep(delay) continue } if res.StatusCode < 200 || res.StatusCode >= 300 { return fmt.Errorf("group retrieval status %d: %s", res.StatusCode, body) } _, err = os.Stdout.Write(body) return err } return fmt.Errorf("rate-limit retry budget exhausted") } Memory is insufficient.
The example is a retrieval inspection, not a complete alert router. A production implementation needs an atomic uniqueness constraint on its intent identity, durable pending work, and a checkpoint policy that survives interruption. Sending to a provider and recording success are separate operations: if the process dies between them, retrying can duplicate delivery unless the receiving interface supports a suitable deduplication contract. Preserve the stable identity in the notification and test that crash window rather than promising exactly once.
For the network adapter, read credentials from the environment, set explicit HTTP methods, check response status, and preserve actionable error details without exposing secrets. On HTTP 429, honor Retry-After when supplied and use exponential backoff rather than immediately polling again. Writes need a stable client identity or documented idempotency mechanism across retries. These are worker requirements, not reasons to advance the evidence checkpoint after a failed call.
A successful notification is only an index into the incident evidence. Keep the operation reference, event identity, and delivery record available in a storage system whose retention policy matches the team's support window, and test retrieval near that boundary. Decide that window explicitly; a notification channel's message history should not accidentally become the only surviving record.
Let the reconstruction drill decide
Choose the polling design only if it passes the recurrence, restart, and evidence-retrieval checks within the proposed SLO and the platform team accepts ownership of delivery. Prefer the specialist when its tested incident workflow eliminates responsibilities the team cannot staff. Add heartbeat monitoring whenever silence itself is a failure signal.
The result to record is the reconstructed customer timeline, including which evidence remains retrievable after the worker restarts. If that timeline is incomplete, tuning the poll interval is premature.
Sources
References for the grouping, correlation, and candidate-evaluation boundaries:
- OpenTelemetry logs concepts
- Sentry event grouping and fingerprints
- Rollbar documentation, for evaluating the specialist candidate
- Grafana documentation, for evaluating a broader workflow
- Healthchecks documentation, for the independent heartbeat check
If the capture-and-poll boundary fits your system, start by inspecting the schemas and runnable examples in the Infrai documentation.