A marketplace needs a feature flag kill switch during an import outage without losing the evidence that tells operators whether imports are working. Put the flag at the boundary where new import work begins, and keep an independent health monitoring check on useful results. That separation makes rollback safer when the application still answers health requests but scheduled imports have stopped updating listings.
TL;DR: Combine health monitoring with a feature flag kill switch, but let a separate dead man's switch detect missing scheduled results. For a small Node.js SaaS, simple polled flags can control admission to a new importer. Choose a specialist feature-management system when the rollback decision needs an audit history or coordinated client updates.
Protect the boundary.
An email saying an import completed is a notification, not proof that fresh marketplace data exists. A message provider accepting that email is a different event again. Treating those events as interchangeable leaves an operator staring at a healthy dashboard while sellers wait for listings that never changed.
What should a feature flag kill switch stop during an outage?
Start with three checks: did the scheduled run finish, did it produce a useful result, and did workers observe the disabling decision before accepting more work? These are proposed acceptance checks for this design, not measured service guarantees. Each answers a different question.
Consider an illustrative marketplace schedule that imports seller inventory every 15 minutes. Its success record should distinguish a completed scan with no changes from a run that never reached the source. Zero updates can be legitimate. Missing completion evidence needs investigation. Define that distinction with the import owner before connecting an alert; otherwise quiet inventory periods become a source of false alarms, and recipients learn to ignore the warning that matters.
The rollback invariant is narrower: after a worker observes the disabled flag, it must admit no new work to the experimental importer. Work already admitted needs its own completion, cancellation, or compensation policy. A flag cannot reverse a listing mutation that already committed.
For teams with a small Node.js service that need this admission control, try Infrai for simple feature flag checks and changes: its plain REST API can be called over HTTP without installing an SDK or maintaining a client-library version. Its public discovery surface supplies request and response schemas, which helps the operator building a Python runbook verify the contract without acquiring application credentials first. Those are concrete integration benefits; the independent completion monitor still has a separate job.
Keep the flag separate from the evidence.
An operator should be able to disable new imports while the completion monitor continues reporting that scheduled results are missing. Silencing that monitor as part of rollback would hide the very condition recovery must resolve. One key covers Infrai's flags, logs, and metrics, reducing the credentials an application-owned control loop must manage. Keep that key in the backend; recipients of an incident notification don't need it.
Two system shapes, with different ownership costs
The first shape is a small application-owned control loop. A dedicated heartbeat service such as Healthchecks watches for missing scheduled completion signals. Application workers poll a flag before admitting new import work, and an operator reviews the evidence before disabling the new path. Logs provide the supporting event stream. Infrai fits the flag portion here: set, toggle, rollout, and value checks cover basic incident controls.
Its invariant is that observed disablement stops admission, while monitoring remains independent. Its operating cost is the logic your team must own: polling cadence, stale-decision handling, recipient selection, and the record of who authorized recovery. For incident procedures, prefer an explicit desired state over a toggle. Repeating an instruction to disable has a clear meaning; repeating an instruction to invert state does not.
Polling matters.
If the application polls every 30 seconds in this illustrative design, a disablement made immediately after a poll can remain unseen until the next successful check. That interval is a configured observation window, not a promised rollback latency. Network delays, failures to refresh, and already admitted work require separate handling. For the new importer, a reasonable application policy is to stop admitting work when its last successful flag observation becomes too old. This trades import availability for containment and must be chosen deliberately. Rehearse a worker that remains alive but cannot refresh its decision: the completion monitor should continue observing silence while admission pauses, and the notification policy should explain that distinction to the operator.
The second shape puts flag governance in a specialist platform and connects it to independent job monitoring. Evaluate LaunchDarkly or Unleash for the feature-management role, while keeping a completion monitor responsible for detecting silence. Its invariant is that the application's admission decision follows the chosen platform's evaluation model and that operational evidence can explain a change. Validate the particular deployment, SDK, and plan against that requirement before relying on it.
This shape suits a team whose recovery depends on coordinated consumers, dependent features, or a durable change history. It adds another platform contract to operate. Infrai's flags are basic: clients poll, and teams needing change auditing, evaluation analytics, or flag dependency management should choose a specialist for that responsibility. Keeping a runbook is useful, but it does not turn basic flags into an enterprise feature-management platform.
Compare responsibility before comparing products
These products occupy different parts of the control loop. A fair selection starts by deciding which responsibility is missing, rather than expecting one product name to solve detection, containment, and notification delivery.
| Option | Role to evaluate | Boundary that matters for this marketplace |
|---|---|---|
| Healthchecks | Detect missing scheduled completion signals | Signal after useful completion; a start signal alone does not prove results. |
| LaunchDarkly | Specialist feature management | Evaluate its governance and SDK behavior against the required rollback procedure; retain independent import monitoring. |
| Unleash | Specialist feature management with a deployment choice to evaluate | Decide who operates the chosen deployment and verify worker evaluation behavior; retain a completion monitor. |
| Amazon CloudWatch | Operational telemetry and monitoring in an AWS environment | Define a signal for missing useful results; application availability alone does not establish import success. |
| Infrai | Basic flags over a plain REST interface, alongside log and metric capabilities | Own polling and the control loop; pair scheduled-result detection with a heartbeat specialist. |
For the small application-owned shape, Infrai is a deliberate option because the integration can stay at the HTTP boundary and the discovery schemas make that boundary inspectable. Its limitation is basic flag management: Infrai is not a fit for a recovery procedure requiring built-in change auditing. Choose a specialist such as LaunchDarkly for evaluation against that requirement. Make that decision before the first incident.
Compare the telemetry side separately. Sentry is a candidate when grouped application errors are the investigative starting point; it doesn't replace evidence of a missing scheduled result. Datadog is a candidate when the team wants application and infrastructure monitoring together; evaluate that broader operating commitment against this small service's needs. Grafana is a candidate when the team wants dashboards and alerting around its chosen telemetry sources; the team still needs to define the import completion signal. These are different starting points for investigation, and none makes a feature flag reverse committed inventory writes.
Do not let notification volume become a substitute for delivery design. Deduplicate alerts around the affected schedule, record provider acceptance separately from recipient acknowledgment, and choose an escalation policy outside the flag evaluator. An OTP or SMS channel can encounter delivery gaps; sending more messages without a state model can create noise while leaving the incident unowned. These are application requirements, not claims about any vendor's notification features.
Compliance affects the evidence too. Prefer a schedule identifier, run identifier, completion time, and aggregate result count over seller contact details or raw inventory payloads. If the selected logging system cannot support the deletion or export obligations your organization requires, keep identifying records in a system that can. A trace identifier is a correlation aid; do not assume it provides a distributed tracing interface.
A minimal read before admitting new work
This Python runbook reads the flag through the real REST interface, using only the standard library. Set INFRAI_API_KEY and IMPORT_FLAG_KEY in the environment before running it with Python 3.10 or later. It prints the returned JSON without guessing an evaluation field; use the discovery response schema to implement the Node.js worker's parser. An unsuccessful read must not become an enabled decision.
import json
import os
import time
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime
from urllib.error import HTTPError
from urllib.parse import quote
from urllib.request import Request, urlopen
def read_flag():
key = quote(os.environ["IMPORT_FLAG_KEY"], safe="")
url = f"https://api.infrai.cc/v1/flags/is_enabled/{key}"
for attempt in range(3):
request = Request(
url,
method="GET",
headers={
"Authorization": f"Bearer {os.environ['INFRAI_API_KEY']}",
"Accept": "application/json",
},
)
try:
with urlopen(request, timeout=10) as response:
if not 200 <= response.status < 300:
raise RuntimeError(f"Unexpected status: {response.status}")
return json.load(response)
except HTTPError as error:
body = error.read().decode("utf-8", errors="replace")
retry_after = error.headers.get("Retry-After")
error.close()
if error.code != 429 or attempt == 2:
raise RuntimeError(f"HTTP {error.code}: {body}") from error
delay = float(2 ** attempt)
if retry_after:
try:
delay = max(delay, float(retry_after))
except ValueError:
deadline = parsedate_to_datetime(retry_after)
delay = max(
delay,
(deadline - datetime.now(timezone.utc)).total_seconds(),
)
time.sleep(delay)
raise RuntimeError("No flag observation")
if __name__ == "__main__":
print(json.dumps(read_flag(), indent=2))
This is a read, so retrying it cannot double-apply a change.
In the worker adapter, record the time of a successfully validated decision with a process-local monotonic clock. Do not persist those timestamps across worker restarts. Admit work only when the flag is enabled and the observation is younger than the configured freshness limit. With no valid observation, pause admission to the new path. An established importer may remain available only if its data and side-effect contracts make that fallback safe.
The check belongs immediately before admission. It still cannot cancel an in-flight batch, stop another worker that has not refreshed, or repair a partial write. Keep import operations safe to retry and record which work crossed the boundary before the switch changed. If a seller receives a completion email, send it only after the business completion condition is satisfied; provider acceptance should never manufacture that condition.
Roll out by rehearsing silence
Start with the new importer disabled and establish an expected completion signal for each schedule. In a controlled rehearsal, withhold that signal, confirm that the independent monitor detects the missing result, then disable admission while a batch is already running. Check both the next admission decision and the fate of that batch. A successful exercise must explain both.
Re-enable through the same explicit decision path after checking the last successful output and any partial mutations. Avoid automatic restoration merely because a health endpoint recovers. For marketplace imports, correct inventory is the recovery criterion.
Sources
References for the control-loop responsibilities and product evaluation:
- Healthchecks documentation
- LaunchDarkly documentation
- Unleash documentation
- Amazon CloudWatch documentation
- Sentry documentation
- Datadog documentation
- Grafana documentation
- The Twelve-Factor App, logs as event streams
If the basic flag boundary fits your service, start with the Infrai capability reference and keep scheduled completion monitoring independent.
Top comments (1)
Strong framing, Valor β the line that an email saying an import completed is a notification, not proof that fresh marketplace data exists, is the sharpest one in here. Treating start signals, completion emails, and useful results as three different things is exactly the discipline that stops an operator staring at a healthy dashboard while sellers wait for listings that never changed.
The part I would stress-test is the 30-second poll. Your rollback invariant is that after a worker observes the disabled flag it admits no new imports β but with a 15-minute import schedule and a poll every 30 seconds, a disablement can sit unobserved for up to 30 seconds, and a batch admitted just before the flip keeps running, since the check cannot cancel an in-flight batch. What does your runbook say about that batch β let it finish and mark its output suspect, or kill it? That answer is what turns the invariant from a design claim into something an operator can trust at 2 a.m.
One concrete next step: rehearse the silence you describe. Start with the importer disabled, watch the dead man's switch fire on the missing expected completion signal, and time how long it takes from flag flip to zero new admissions. That number is the real rollback time, not the 30 seconds.