A polling interval consumes part of the incident detection budget before anyone receives a notification. TL;DR: for a customer support experiment, separate error collection from alert delivery, compare failures against each tenant cohort's workload, and choose a hosted alerting tool when the team cannot own a scheduled evaluator and its delivery state. Searchable failures are useful evidence; they don't, by themselves, establish that an experiment deserves a page.
Consider a hypothetical production review, not a reported incident: I am deciding whether to stop an experiment that changes how support agents handle tickets. In a deliberately constructed ten-minute window, the treatment cohort has 12 failed operations out of 200 attempts, while the control has 20 out of 2,000. Counting failures alone makes control look worse. The illustrative rates are 6% and 1%, respectively, which reverses that ranking, although those counts still don't establish statistical significance or prove that the experiment caused the difference.
Traffic changes everything.
The lesson is an invariant: a notification must preserve the population and denominator behind its threshold. Otherwise, a busy tenant can dominate the aggregate while a smaller, damaged tenant cohort disappears inside it. The platform roadmap should fund that measurement contract before adding another notification destination.
How should error tracking threshold rules turn cohort failures into alerts?
Define the unit of failure first. A ticket operation, an error event, and an error group are different units; repeated failures can produce many events, and grouped incidents cannot supply the number of successful operations. For this experiment, use attempted support operations as the denominator, assign each operation to treatment or control at the time it happens, and keep a stable tenant identifier in the application's measurement record. These are instrumentation requirements, not assumptions about fields a particular query API accepts.
Then write the decision in operational terms. An illustrative rule might require at least 200 attempts in each cohort during a ten-minute evaluation window, a treatment failure rate above the team's declared objective, and a treatment/control difference that persists across two evaluations. Those numbers are proposed settings for review, not recommended defaults or measured results. A low-volume tenant may need a longer window; an urgent, severe failure may need a separate escalation policy. Waiting for sample volume is itself a trade-off.
The threshold should be attached to the support workflow's SLO. If the objective measures successful ticket operations, a release comparison is evidence about that objective, while a page should reflect a response someone can usefully take. Keep an absolute failure condition alongside the relative comparison: equal damage in both cohorts can make the experiment comparison look reassuring while customers are still failing.
A quiet comparison can be wrong.
The concrete trap is to interpret an empty query result as zero failures before checking collection freshness and denominator availability. Record the last successful evaluation separately from the last observed error, and classify an incomplete window as unknown. That distinction costs some dashboard simplicity, but it keeps a stalled collector from manufacturing apparent health.
Polling introduces a budget, a checkpoint, and another service to own
Error tracking can collect and query failures while a scheduled worker evaluates thresholds and sends Slack or email. In that design, threshold rules, notification routing, webhook delivery, and phone or SMS escalation are separate responsibilities. A query API being free to call would not settle the operational question: someone still owns evaluation, delivery, and recovery after the worker stops.
For an illustrative schedule of one poll every 60 seconds, the scheduler alone can add almost a minute before an event is examined; ingestion delay, query duration, and notification delivery add further time. This is arithmetic about the proposed schedule, not a vendor latency claim. Compare the whole detection path with the incident's allowed detection time before promising an alerting SLO.
Capacity planning belongs here too. If one evaluation issues two queries, 100 independently polled tenant cohorts on that schedule produce 200 queries per minute before retries. A shared evaluator may reduce repeated retrieval, but only if the actual query contract and returned data support the needed grouping. Don't invent server-side tenant filters to make the spreadsheet work. Start with the documented schema and budget the response volume as well as request count.
Use a durable checkpoint and an overlapping lookback whose size follows the ingestion behavior you have verified. Deduplicate observations by a stable event identity when the source supplies one. A timestamp by itself cannot distinguish two events that share that timestamp, and a group identity cannot distinguish successive events in the same group. After evaluation, retain a delivery record keyed by the cohort, rule version, and window so a retried worker can recognize an already-handled decision.
Delivery needs its own state.
Advancing the checkpoint before a notification is durably recorded can lose the notification; sending first and crashing before recording success can repeat it. An outbox makes pending delivery explicit, although an external destination still needs a deduplication mechanism if exact-once delivery is required. Rate-limited requests need backoff that honors Retry-After when present. Retrying immediately only spends the capacity reserved for recovery.
Finally, watch the evaluator from outside its own process. A missing scheduled evaluation is a silent failure, which is why a heartbeat service such as Healthchecks belongs in the discussion even though it doesn't replace error investigation.
Buy versus build depends on who owns the next notification
The comparison should start with delivery ownership and signal quality, not a list of ingestion endpoints. Hosted notifications can remove plumbing, but they cannot infer the correct support-operation denominator from an exception count.
| Option | What it contributes | Boundary to examine for this experiment |
|---|---|---|
| Sentry | Error investigation with documented alerting workflows | Check that the selected alert type can express the cohort decision; an issue notification alone is not a treatment/control test. |
| Datadog | Log investigation and monitor workflows | Useful when the team already operates monitors; confirm the cohort fields, evaluation window, and notification ownership before adding another monitor. |
| Grafana Alerting | Query-based alert rules and notification policies | Fits teams already maintaining suitable data sources; the rule still depends on valid cohort measurements and someone owning the data pipeline. |
| Scheduled evaluator over query APIs | Direct control over denominators, suppression, and delivery state | The platform team owns retries, checkpoints, heartbeat coverage, and rule maintenance. |
Infrai fits the last option as a plain REST API with one key and one bill for the combined workflow: an HTTP-capable worker can query it without installing an SDK or maintaining a client library version. The single key connects account inventory and log investigation without a second credential handoff. Its public discovery schemas also let the team inspect request and response contracts before committing the evaluator to them.
That combination has an ownership consequence: one vendor to trust, one bill, and one outage surface. A vendor console plus Datadog Logs would instead mean two service accounts or signups, two credential sets, and glue to carry the account identifier into the log investigation. Existing organizational accounts may already cover those signups; the integration work still needs an owner. Consolidation reduces that seam without proving the combined service meets your detection SLO.
Preserve the account-to-log handoff without inventing a filter
A suspected account-key compromise during an experiment creates a second question: are the observations evidence of a release regression, or do they overlap with a credential investigation? Key rotation and compromise reporting remain incident-response actions; the code below implements only the read-only evidence handoff, not a complete rotation procedure.
This runnable Go program fetches the account key inventory, checks whether an operator-supplied key identifier appears as an exact JSON string value, and passes that confirmed identifier into a local inspection of the log search response. Both requests use the same credential and base URL. It sends no undocumented log filters. The comparison is a candidate correlation, not proof of blast radius: the application must have recorded the identifier, and the returned log data must cover the relevant interval. A negative result establishes neither absence nor safety.
Set INFRAI_API_KEY to the credential, INFRAI_BASE_URL to the documented API base ending in /v1, and ACCOUNT_KEY_ID to a non-secret identifier obtained from your account workflow. Run the saved file with go run main.go. Don't put the credential value in ACCOUNT_KEY_ID.
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"strconv"
"strings"
"time"
)
func get(client *http.Client, base, key, path string) (any, error) {
for attempt := 0; attempt < 4; attempt++ {
req, err := http.NewRequest(http.MethodGet, base+path, nil)
if err != nil { return nil, err }
req.Header.Set("Authorization", "Bearer "+key)
resp, err := client.Do(req)
if err != nil { return nil, err }
body, readErr := io.ReadAll(io.LimitReader(resp.Body, 4<<20))
resp.Body.Close()
if readErr != nil { return nil, readErr }
if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 {
delay := time.Second * time.Duration(1<<attempt)
retry := resp.Header.Get("Retry-After")
if seconds, err := strconv.Atoi(retry); err == nil && seconds >= 0 {
if d := time.Duration(seconds)*time.Second; d > delay { delay = d }
} else if until, err := http.ParseTime(retry); err == nil {
if d := time.Until(until); d > delay { delay = d }
}
time.Sleep(delay)
continue
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return nil, fmt.Errorf("%s returned HTTP %d: %s", path, resp.StatusCode, body)
}
var value any
if err := json.Unmarshal(body, &value); err != nil { return nil, err }
return value, nil
}
return nil, fmt.Errorf("retry budget exhausted")
}
func contains(value any, wanted string) bool {
switch v := value.(type) {
case string:
return v == wanted
case []any:
for _, child := range v {
if contains(child, wanted) { return true }
}
case map[string]any:
for _, child := range v {
if contains(child, wanted) { return true }
}
}
return false
}
func run() error {
key, id := os.Getenv("INFRAI_API_KEY"), os.Getenv("ACCOUNT_KEY_ID")
base := strings.TrimRight(os.Getenv("INFRAI_BASE_URL"), "/")
if key == "" || id == "" || key == id || base == "" {
return fmt.Errorf("set the API base, credential, and a separate non-secret account key ID")
}
client := &http.Client{Timeout: 20 * time.Second}
inventory, err := get(client, base, key, "/account/keys/list")
if err != nil { return err }
if !contains(inventory, id) {
return fmt.Errorf("identifier not confirmed in returned inventory")
}
logs, err := get(client, base, key, "/logs/search")
if err != nil { return err }
fmt.Printf("Candidate identifier match in returned log data: %t\n", contains(logs, id))
return nil
}
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
The generic JSON traversal avoids assuming an undocumented response envelope, but it also cannot distinguish an identifier's semantic role. Before automating a security decision, replace that exploratory comparison with field-aware validation against the discovery schema and an application logging contract. The program caps each response read at 4 MiB and fails JSON decoding when a larger response is truncated; it is a bounded diagnostic, not a bulk export or a complete audit.
Account evidence must not silently rewrite experiment membership. Preserve the original cohort assignment, annotate the investigation separately, and let the incident owner decide whether the window is contaminated. Otherwise the same automation meant to improve signal quality can erase the population that made the failure visible.
When should this design stop at searchable incidents?
A beginner whose immediate need is searchable incidents and a simple dashboard can stop before owning notifications. A team promising an urgent response should buy an alerting workflow or explicitly staff the scheduled evaluator, including its heartbeat and delivery recovery. A severe detection requirement with little polling headroom is a poor match for an improvised periodic worker.
Keep investigation requirements separate as well: verify distributed trace and span-tree navigation, source-map decoding, crash symbolication, and session replay when they are part of the support workflow. Neither a trace identifier in a log nor an error notification establishes those capabilities. Likewise, confirm retention, export, deletion, and experiment-assignment audit requirements before treating search results as a lasting experiment record.
The release decision is narrower than the tool decision: promote only when cohort evidence meets the agreed rule and the evaluation window is complete. Unknown evidence should hold the experiment for investigation. It should never become a green notification by accident.
References
The sources below cover competitor alerting and notification workflows, heartbeat monitoring, and HTTP retry semantics. They don't validate the hypothetical cohort counts or establish a benchmark between products; those examples specify the engineering decision to test.
Sources
- Sentry alerting documentation: https://docs.sentry.io/product/alerts/
- Datadog monitor documentation: https://docs.datadoghq.com/monitors/
- Grafana Alerting documentation: https://grafana.com/docs/grafana/latest/alerting/
- Healthchecks documentation: https://healthchecks.io/docs/
- HTTP semantics, including Retry-After: https://www.rfc-editor.org/rfc/rfc9110.html
Top comments (0)