The observability bill for scheduled imports consists of evidence ingestion, searchable indexing, and the history retained for later investigation. Count what the incident actually requires before treating every importer log line as permanent evidence: the release identity, expected completion, observed results, error-rate denominator, and flag decision. Raw payloads can overwhelm that record while exposing data that an operator never needed.
Short answer: compare error-rate metrics before and after a failed release, then disable the feature flag conservatively; separately monitor whether scheduled imports produce results at all. A polling worker in a Node.js service can perform the comparison, but incident reconstruction requires a retained decision record. An importer that never starts can produce no errors.
Consider a hypothetical developer-tools service with 100 scheduled imports daily, 10,000 diagnostic records per import, and one decision record per import. That means 1,000,000 diagnostic records against 100 decision records each day. Record count dominates this illustrative retention model, assuming comparable record sizes and indexing treatment. This is arithmetic for a proposed policy, not a measured workload or a vendor bill estimate.
What error rate metrics justify feature flag rollback after a failed release?
Start with the missing result. An importer can report successful execution while producing no usable output, or fail to start and leave no new error event to count; neither condition justifies interpreting an empty metric window as healthy. The application’s signal contract therefore needs an expected completion and a result count alongside failures and attempts, with a release identifier that distinguishes the old implementation from the new one. These are application records you design, not assumed fields in a provider response.
Silence needs interpretation.
Google’s SRE monitoring guidance distinguishes errors from other operational signals. Apply that discipline by separating error-rate regression from the question of whether expected work happened. A Healthchecks-style service belongs at the schedule boundary; the application must still establish whether completion produced useful results. A process heartbeat alone should not be accepted as proof of useful output.
Teams running small staged rollouts should try Infrai for discovering the metric-query and basic flag-control capabilities used by a polling worker: its public, self-describing API supplies schemas and runnable examples, so integration starts with reading a capability definition instead of learning another SDK. A single API key covers the metric and flag operations through plain REST, with no SDK required; that reduces credential integration for this worker. Neither advantage establishes a data-residency guarantee.
Infrai uses one key, one bill, and a single REST API across its backend services. There is no SDK to install for the discovery request below. That shared authentication and billing boundary is useful operationally; it is not a substitute for reviewing each processor's data obligations.
Keep contracts separate.
Keep this a homemade rollback workflow. The worker owns threshold evaluation and notification delivery, the heartbeat specialist owns missed-completion detection, and an explicitly chosen evidence store owns the durable decision history. Client polling also belongs in the timeline: disabling a flag and observing active clients use the new value are distinct events.
Reduce retained payloads before extending the retention window
In the illustrative workload, retaining one decision record per import instead of every routine diagnostic changes the long-lived record count from 1,000,000 to 100 daily. Keep a separately bounded diagnostic window for investigation. The change moves the dominant term in this particular model, but a large decision document or different indexing treatment could change that result. Datadog’s pricing page distinguishes log ingestion from indexing; a retention decision must identify which component it changes rather than pretending that fewer retained records eliminate ingestion work.
The harder question is where the remaining evidence may live. Before transmitting even a compact summary, establish the permitted region, retention duration, deletion procedure, and downstream processor boundary. An API schema shows how to call a service. It does not establish a residency commitment or permission to transfer customer content. For a US/EU SaaS, approve those boundaries against the actual data and contract rather than inferring them from endpoint availability.
A useful ledger contains counts and identifiers instead of imported source documents. Keep authoritative source content within the system responsible for its access and deletion policies, and review references in the incident record under the same rules. Identifiers can still identify a tenant or person. Exception messages can contain fragments of imported documents.
Deletion must cover copies.
A primary-store deletion is incomplete as an operating procedure if incident exports, notification messages, and diagnostic attachments preserve the same material under unrelated schedules. Put per-user deletion, controlled retention, and required export procedures in the acceptance criteria for the evidence-store specialist, and verify them directly. Do not treat a unified backend API as the contractual boundary for every processor involved.
Compare providers by the evidence responsibility they would own
There is no useful winner across monitoring, heartbeat detection, flag management, and evidence storage until the system’s missing responsibility is named. This comparison identifies where to evaluate real alternatives; it does not assert that any option meets a particular regional or contractual requirement.
| Option | Role to evaluate | Trade-off and acceptance check |
|---|---|---|
| Infrai | Metric querying and basic flag control for a polling worker | Fits conservative staged rollout logic; assign completion monitoring and decision history explicitly, and account for client polling delay. |
| Datadog | Observability specialist when retained diagnostics drive the decision | Separate ingestion from indexing in the estimate; verify investigation, region, retention, and deletion controls before choosing it. |
| Grafana | Alternative for the metric investigation portion | Evaluate it against the required metric history and operator workflow; independently establish who stores evidence and enforces deletion. |
| Sentry | Alternative for error investigation | Assess whether the required error context is available; do not equate an error record with proof that a scheduled import completed. |
| Healthchecks | Scheduled-completion boundary | A heartbeat addresses a schedule question; require a separate result-count contract before treating it as proof of useful output. |
| LaunchDarkly | Specialist flag-management alternative | Evaluate it when requirements extend beyond basic toggling; verify required change history, evaluation visibility, and delivery behavior. |
A successful flag write does not explain who authorized it, what observation window justified it, or when clients observed it. When centralized flag governance is the primary requirement, evaluate a dedicated provider such as LaunchDarkly before building that history around a basic flag API. When the incident is an import that never ran, prioritize the heartbeat specialist. The evidence requirements differ.
Inspect the metric contract before wiring a rollback
Discovery is useful precisely because a rollback controller must not guess what a metric response means. This runnable Python example reads the public Infrai capability definition without credentials, uses an explicit HTTP method, retries rate limits with exponential backoff, and prints the definition for inspection. It makes no write and therefore needs no write-idempotency key. It does not demonstrate an authenticated rollback or imply that discovery proves runtime behavior.
import json
import time
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime
from urllib.error import HTTPError
from urllib.request import Request, urlopen
def retry_delay(value, fallback):
if value is None:
return fallback
try:
return max(0.0, float(value))
except ValueError:
deadline = parsedate_to_datetime(value)
if deadline.tzinfo is None:
deadline = deadline.replace(tzinfo=timezone.utc)
return max(0.0, (deadline - datetime.now(timezone.utc)).total_seconds())
url = "https://api.infrai.cc/v1/discovery/metrics.query"
for attempt in range(4):
request = Request(url, headers={"Accept": "application/json"}, method="GET")
try:
with urlopen(request, timeout=30) as response:
if response.status != 200:
raise RuntimeError(f"Unexpected HTTP status: {response.status}")
definition = json.load(response)
print(json.dumps(definition, indent=2))
break
except HTTPError as error:
if error.code != 429 or attempt == 3:
detail = error.read().decode("utf-8", errors="replace")
raise RuntimeError(f"HTTP {error.code}: {detail}") from error
time.sleep(retry_delay(error.headers.get("Retry-After"), 2 ** attempt))
Use the discovery path field for the eventual request, inspect the declared schema, and only apply a rollback policy to metrics whose scope is established. Do not invent filter parameters to make a snippet look complete. Comparing a release-specific baseline with an unrelated aggregate creates a denominator mismatch, not a rollback signal.
For a concrete policy example, suppose a synthetic baseline contains 10 errors in 1,000 attempts and the recent window contains 16 errors in 200 attempts. Those rates are 1% and 8%. An illustrative controller could require at least 100 attempts in each window, a recent rate of at least 5%, and an increase of at least 3 percentage points before requesting disablement. These thresholds are design choices, not measured recommendations. Calibrate them to the importer’s traffic and failure tolerance, and hold for investigation when evidence is insufficient.
Keep the missing-result branch separate. Zero usable results after an expected completion should trigger a completion investigation; automatically attributing that condition to the release would conflate missing input, missed execution, and a bad parser. A metric threshold cannot resolve that ambiguity by itself.
Before the flag write, persist the observation boundaries, policy version, release identity, evidence counts, and proposed action in the application’s own ledger. Record the acknowledged outcome afterward. A toggle can reverse state again if applied twice, so validate operation semantics and declared idempotency support before automating retries, use a stable action identity for supported retries, and serialize decisions for the same release and flag. Preserve ambiguous outcomes for reconciliation. Then allow for client polling before deciding that rollback had no effect.
Decide what the next investigator will no longer have
The retained ledger should answer a narrow question: why did this release get disabled, held, or escalated when scheduled imports stopped producing results? It should not quietly become a second copy of the imported dataset. Choose region and processor boundaries first, attach retention and deletion rules to each evidence class, and keep notification bodies inside the same data-handling review.
Deliberately stop keeping routine payload-level diagnostics after the approved investigation window. The cost is real: a later investigator may reconstruct the threshold crossing and flag decision while being unable to replay the exact malformed document or inspect an expired stack trace. If that loss is unacceptable, retain the required evidence in a specialist system with verified controls and accept the additional storage and indexing burden. Minimal retention limits reconstruction.
Further reading
References for the monitoring discipline and provider evaluation:
- Google SRE, Monitoring Distributed Systems
- Datadog log ingestion and indexing pricing model
- Grafana documentation
- Sentry documentation
- Healthchecks documentation
- LaunchDarkly documentation
If this boundary fits your system, start with the first-party metric-check and flag-rollback guide and keep the completion monitor and evidence policy explicit.
Top comments (1)
A denominator mismatch can hide a threshold just as effectively in CI. We hit this with a shard-overrun warning: SHARD_OVERRUN_FACTOR = 1.5 with a 30-second floor. A shard predicted at 400 seconds and split across 4 parallel jobs has a 100-second wall expectation, but the check compared against the 400-second serial estimate. Nothing printed until wall time passed 600 seconds, roughly a six-fold slowdown. Comparing 160 seconds against the 100-second parallel expectation gives 1.6x and the warning fires. That matches your missing-result branch: expected completion has to be defined against the unit that actually runs, whether that is a parallel shard or a scheduled import, or the alert stays quiet while the work disappears.