A customer incident must remain reconstructable when its failure notification cannot be delivered. TL;DR: use exponential backoff, a maximum attempt count, and a circuit breaker for failed webhook delivery; retain the original incident separately from notification attempts so a rollback decision doesn't depend on a working alert destination.
A quiet dashboard proves little.
For a customer support service, the useful question is narrower than whether another retry might work: can the responder distinguish the customer failure, the attempted notification, and the release being considered for rollback? Those are the 3 evidence boundaries in this design. Crossing them carelessly lets a notification outage masquerade as a new customer incident.
What should retries preserve after failed webhook delivery?
Consider a hypothetical production exercise: a support conversation fails during a release, and its failure alert cannot reach the receiving webhook. I would ask what page fired before looking at the dashboard, then ask which conversation and release the underlying incident record identifies. This is a design exercise, not a report of an observed customer outage. Use a synthetic incident named support-case-42 and one alert destination; the numbers below are policy choices, not measurements.
Keep the receipt.
A successful delivery attempt establishes that the receiver accepted a request under the sender's success policy. It doesn't establish that a human read the alert, that a support conversation recovered, or that a rollback is safe. Conversely, an unsuccessful delivery establishes a notification problem; it should not create another copy of the customer incident every time the sender tries again. A postmortem needs both histories, connected by a stable incident identifier, because their timelines can diverge precisely when the responder most needs them.
Retrying delivery must not rewrite the evidence that justified the alert. Keep the original incident identifier, the affected conversation reference, and the release identity in an application-owned record. Store delivery attempts alongside it, including their ordinal, outcome, and next permitted attempt time. These are proposed application records, not fields promised by an observability provider.
A rollback can address a release implicated by the original evidence while the notification worker reports its own state. Neither an open circuit nor an exhausted retry budget should automatically authorize a rollback.
Backoff needs an end state that survives the investigation
Exponential backoff increases the interval between failed attempts. A maximum attempt count makes the work finite. A circuit breaker does something different: after a configured failure threshold, it stops calls to the affected destination for a cooling period, even if an individual notification still has attempts left. Put the breaker at the destination boundary; a counter attached only to one event cannot protect a receiver from many different events.
A pause is evidence.
For an exercise, choose a 1-second initial delay, a 4-second delay cap, at most 5 attempts per delivery, and a breaker that opens after 3 consecutive unsuccessful calls to the same destination. Allow one probe after a chosen cooling period. These values illustrate the mechanism; they aren't universal settings for support services. A destination that cannot tolerate that cadence needs a different policy, and a notification whose usefulness expires quickly needs an explicit expiry decision.
The trade-off is delayed notification in exchange for limiting pressure on a failing receiver. Record circuit-open and attempts-exhausted as distinct outcomes, because a postmortem needs to distinguish deliberate protection from a spent delivery budget. Make stopped deliveries visible through a path that doesn't depend exclusively on the broken destination. Otherwise the failure alert disappears behind its own delivery failure.
Choose tools by the evidence they preserve
Prometheus Alertmanager, Grafana Alerting, and PagerDuty are useful evaluation candidates, but their workflow emphasis differs. Treating them as interchangeable webhook retry engines skips the question of where customer evidence lives. This comparison doesn't assign an unverified retry schedule to any product.
| Candidate | Relevant workflow emphasis | Boundary to verify |
|---|---|---|
| Prometheus Alertmanager | Alert grouping, routing, and notification handling | Can the receiver configuration and a separate incident store preserve the delivery evidence needed for a release decision? |
| Grafana Alerting | Alert rules, contact points, and notification policies | Can rule evaluation and delivery history be correlated with the affected conversation? |
| PagerDuty | Incident response, on-call escalation, and acknowledgement | Does application evidence remain available independently of responder coordination? |
Alertmanager is a candidate when notification routing is the immediate problem; Grafana Alerting fits an evaluation centered on rules and contact points; PagerDuty belongs in an evaluation centered on reaching and coordinating responders. Check the relevant receiver documentation and exercise the actual configuration before assigning it a rollback role. A product name can't certify that an incident is reconstructable.
Infrai provides a plain REST API with one key, one bill, and a consistent interface across 295 routes and 20 modules. There is no SDK to install or client library version to maintain; anything capable of sending HTTP can call it. A single key and unified billing reduce credential and invoice coordination when an incident collector also uses other backend capabilities. The public, self-describing discovery surface supplies request and response schemas without requiring authentication, which helps check the collector's contract before deployment. Keep the notification worker and responder workflow separate in this architecture. An API integration alone is not a fit for a team whose primary requirement is managed on-call escalation; evaluate PagerDuty for that workflow instead.
The limitation of choosing an evidence API is the delivery policy your application must own. That is a reasonable choice for a team already maintaining a worker, but not a shortcut around operating one.
OpenTelemetry's logs concepts provide a reference for the evidence side. Keep correlation identifiers attached to the incident and its delivery attempts. Establish retained records and their correlation before treating a dashboard view as the account of what happened.
Make evidence retrieval bounded before wiring notification delivery
The standalone Go example reads error-group evidence through the verified read route. Set INFRAI_API_KEY, ERROR_GROUP_ID, and INFRAI_API_BASE to your API key, error-group identifier, and the official HTTPS API origin including its version prefix. The origin is configuration rather than an embedded vendor URL.
This is the evidence-fetch step before constructing a notification, not a webhook sender. It demonstrates bounded retries and an explicit stopping condition without inventing an alert endpoint or a response schema. The output is the response body, which the application must associate with its own conversation and release record.
package main import ( "context" "fmt" "io" "net/http" "net/url" "os" "strconv" "strings" "time" ) func retryDelay(header string, fallback time.Duration) time.Duration { if seconds, err := strconv.Atoi(header); err == nil && seconds >= 0 { candidate := time.Duration(seconds) * time.Second if candidate > fallback { return candidate } } if when, err := http.ParseTime(header); err == nil { if candidate := time.Until(when); candidate > fallback { return candidate } } return fallback } func fetch(ctx context.Context) error { base := strings.TrimRight(os.Getenv("INFRAI_API_BASE"), "/") key := os.Getenv("INFRAI_API_KEY") group := os.Getenv("ERROR_GROUP_ID") parsed, err := url.Parse(base) if err != nil || parsed.Scheme != "https" || parsed.Host == "" || parsed.User != nil || parsed.RawQuery != "" || parsed.Fragment != "" || !strings.HasSuffix(parsed.Path, "/v1") || key == "" || group == "" { return fmt.Errorf("set an HTTPS versioned API base, key, and group") } endpoint := base + "/errors/events/" + url.PathEscape(group) client := &http.Client{ Timeout: 5 * time.Second, CheckRedirect: func(*http.Request, []*http.Request) error { return http.ErrUseLastResponse }, } delay := time.Second failures := 0 for attempt := 1; attempt <= 5; attempt++ { req, err := http.NewRequestWithContext(ctx, http.MethodGet, endpoint, nil) if err != nil { return err } req.Header.Set("Authorization", "Bearer "+key) resp, callErr := client.Do(req) wait := delay retryable := true if callErr == nil { payload, readErr := io.ReadAll(io.LimitReader(resp.Body, 1024*1024+1)) resp.Body.Close() if readErr != nil { return readErr } if len(payload) > 1024*1024 { return fmt.Errorf("response exceeds example evidence limit") } if resp.StatusCode >= 200 && resp.StatusCode < 300 { _, err = os.Stdout.Write(payload) return err } fmt.Fprintf(os.Stderr, "attempt=%d status=%d body=%s\n", attempt, resp.StatusCode, payload) retryable = resp.StatusCode == 429 || resp.StatusCode >= 500 if resp.StatusCode == 429 { wait = retryDelay(resp.Header.Get("Retry-After"), delay) } } else { fmt.Fprintf(os.Stderr, "attempt=%d error=%v\n", attempt, callErr) } if !retryable { return fmt.Errorf("request rejected; inspect response") } failures++ if failures >= 3 { return fmt.Errorf("circuit_open: defer destination calls") } if attempt == 5 { return fmt.Errorf("attempts_exhausted") } timer := time.NewTimer(wait) select { case <-ctx.Done(): timer.Stop() return ctx.Err() case <-timer.C: } delay *= 2 if delay > 4*time.Second { delay = 4 * time.Second } } return fmt.Errorf("attempts_exhausted") } func main() { ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) defer cancel() if err := fetch(ctx); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } The third retryable failure opens this invocation's circuit before it can consume the fifth permitted attempt. The example's initial backoff is 1000 ms and its overall deadline is 20 seconds. Retry-After can extend the local delay; the overall deadline can stop the operation rather than retrying earlier than the receiver requested. Rejected requests outside the retryable class surface their status and body instead of being sent indefinitely.
Don't confuse a local stop with a fleet-wide breaker.
The example doesn't persist breaker state or schedule a recovery probe. A deployed worker must share destination state across invocations, retain pending work, and coordinate a single probe after its cooling period. Otherwise restarting the process resets the counter and defeats the protection. The read request above has no write side effect; webhook delivery needs a stable delivery identity and receiver-side deduplication before retrying actions. A lost response doesn't prove the receiver did nothing.
When should this change the rollback decision?
Use original customer evidence to identify the implicated release; use delivery history to establish uncertainty in the notification timeline. Before approving a rollback, a responder should recover the affected conversation reference, release identity, incident record, and pending or final delivery state without requiring the receiver to recover first. That's an acceptance criterion for an exercise, not an uptime claim.
This design doesn't apply unchanged when there is no durable incident record, when the receiving action cannot safely repeat, or when the real problem is a job that never ran and emitted no failure event. Solve those evidence, side-effect, or heartbeat problems explicitly.
More retries cannot manufacture a missing incident.
Sources
References for evaluating notification workflows and retained evidence:
