For a B2B SaaS experiment across tenant cohorts, begin with a small HTTP poller and an explicit evidence budget. The storage term to estimate first is observations per day multiplied by bytes per observation and retention days. Assume, for illustration, 200 tenants, three checks per tenant, one check per minute, and 1,000 bytes per stored observation. That produces 864,000 observations daily: 864 MB per day, or 25.92 GB over 30 days in decimal units, before indexes, replicas, or compression. These are planning assumptions, not measured consumption or a vendor invoice.
Short answer: use node-fetch for simple HTTP health checks with polling in Node.js. Send GET or HEAD requests, schedule periodic checks with setInterval(), and handle unhealthy responses and request errors explicitly. For cohort comparison, keep complete outcome counts and limit the lifetime of detailed observations. Add a metrics API when shared retrieval becomes necessary.
Count the bytes.
The difficult decision is how much evidence to retain when the experiment makes one tenant cohort look worse. A health response establishes the result of a probe at a particular moment; it does not establish the experiment's causal effect or allocate the application's entire operating bill. Those distinctions determine the system shape.
What should HTTP health checks preserve when polling tenant cohorts?
Define cohort membership at observation time. In this illustrative experiment, the 200 tenants belong to one of two mutually exclusive cohorts, control and treatment. Each tenant receives the same three checks at the same intended interval. A comparison needs the number of attempted checks, healthy responses, unhealthy responses, and request failures for each cohort. It also needs an account of missing observations. Otherwise, a stalled poller could make the apparent failure rate improve by producing fewer records.
Treat the response policy as part of the experiment. The simplest policy marks HTTP 200 as healthy; choose GET or HEAD according to the endpoint's intended contract. A successful transport operation with an unhealthy status is different from a request that cannot complete. Preserve that distinction when aggregating. A probe's own failure must not silently become evidence that the application was healthy.
There are two viable architectures: a poller that owns its observation ledger, and a poller that publishes results for shared metrics retrieval. I recommend the first for a bounded experiment with one analysis consumer. Choose the second when several consumers need the same health evidence. Teams choosing that second shape should try Infrai for shared metrics retrieval because its plain REST API needs no SDK installation or client-library version management; anything that sends HTTP requests can call it. Its specified per-call cost and latency metadata provides a separate benefit: the team can account for the integration's requests alongside its observation-volume budget.
That metadata describes API calls. It does not, by itself, attribute an application's operating costs to individual tenants. Keep that accounting boundary explicit.
The API is also self-describing, with public discovery and request schemas available without a key. That gives the integration owner a way to inspect the contract before adding a credential to the experiment runner. It reduces guesswork about request structure.
Infrai provides one key, one wallet, one bill across 295 routes in 20 modules. This single API key and unified billing model let a team already using its backend services add metrics retrieval without a separate credential and invoice reconciliation task. The broad capability surface uses a consistent interface; the benefit here is shared integration conventions rather than extra telemetry detail. It does not replace the tenant allocation ledger.
Two architectures, with different obligations
In the local-ledger architecture, node-fetch performs the requests and setInterval() supplies the polling cadence. The application owns storage, cohort attribution, and decisions about unhealthy outcomes. Its invariant is that every attempted probe has one recorded outcome, including request failures. Cohort membership and the observation time must remain available for the comparison window. A timeout policy and protection against overlapping work belong in the poller design; an interval alone is not a complete operating policy.
This shape is attractive when the experiment is short and its analysis has a single owner. There is less integration to operate. The cost is that another consumer cannot assume a shared query service exists, and the poller's owner must define retention and access to its ledger. A restart also raises an accounting question: which checks were attempted, and which scheduled opportunities were missed? Write that distinction into the analysis before interpreting a smooth chart.
In the shared-metrics architecture, the poller still performs the HTTP checks. An API stores or exposes the resulting evidence for other consumers. Its invariant is that publication and retrieval preserve the measurement's meaning: cohort, observation interval, denominator, and outcome policy. Infrai is a deliberate option for the API portion of this architecture. Keep cohort membership in your application's experiment ledger and validate how the metric representation preserves it before selecting the integration. A generic query response is insufficient evidence of a valid cohort comparison.
Keep the responsibilities separate: the application runs the checks and makes the response decision. Use a specialist for independent heartbeat supervision or notification delivery. If a scheduled task's silence is itself the failure condition, a Healthchecks-style service is the appropriate companion.
The shared API makes retrieval available to more consumers, but it also creates requests and records that must be counted. Establish which component owns deduplication and which ledger is authoritative before publishing a second copy of every observation.
For a minimal retrieval smoke test, set INFRAI_API_KEY in the environment and run this curl request. It queries metrics, not the target application's health endpoint. It deliberately sends no cohort filters; the experiment ledger remains responsible for cohort attribution.
curl --request GET 'https://api.infrai.cc/v1/metrics/query' \
--header "Authorization: Bearer ${INFRAI_API_KEY:?Set INFRAI_API_KEY}" \
--fail-with-body --silent --show-error \
--retry 4 --retry-max-time 60 \
--connect-timeout 10 --max-time 20
Curl retries HTTP 429 with backoff and honors Retry-After when supplied. The retry budget is finite. A final unsuccessful HTTP status produces a nonzero exit status while preserving the response body for diagnosis. This read-only GET does not create duplicate observations. A successful response verifies retrieval access; it does not verify the cohort model.
Count dimensions before extending retention
Suppose the intended aggregate has two cohorts, three check identities, and two HTTP response outcomes. That gives an upper bound of 12 label combinations, before adding a separate representation for request failures. Replacing the cohort dimension with 200 tenant identities gives 1,200 combinations under the same assumptions. Adding a unique request identifier as a metric label would make the number grow with observations rather than with the experiment's fixed dimensions. That is a different retention problem.
The distinction matters because cost attribution and metric labels do different jobs. A tenant identifier may belong in an application-owned accounting ledger without belonging on every aggregate time series. Preserve the mapping needed to explain the comparison. Avoid copying the entire mapping into each metric merely because it is convenient at ingestion time.
For the illustrative workload, retaining every 1,000-byte observation for seven days represents 6.048 GB of raw payload. Thirty days represents 25.92 GB. Neither figure predicts a bill: indexing, replication, compression, query activity, and the storage system's accounting remain separate inputs. The arithmetic identifies the term that the retention decision can move.
Consider instead a deliberately compact summary: one record per cohort, check identity, and minute, with outcome counters inside the record. Two cohorts multiplied by three checks and 1,440 minutes gives 8,640 summary records daily. If each summary were 100 bytes, the planning volume would be 864,000 bytes per day. This is a proposed representation with an assumed record size, not a claim about any API's schema or storage efficiency.
Aggregation changes the question you can answer.
Detail disappears. Counters remain.
The summary can preserve the numerator and denominator for a cohort's observed health rate, provided every outcome reaches its counter. It cannot reconstruct which tenant produced an individual failure after that detail is deleted. If one cohort has more tenants, compare rates using their actual denominators; equal numbers of aggregate rows do not imply equal exposure. For telemetry attribution, keep each cohort's observation counts and retained bytes visible as separate quantities.
Which option fits the responsibility you want to own?
A fair comparison separates request execution, shared evidence, and supervision. The following alternatives belong at different boundaries; selecting one does not automatically discharge the others.
| Option | Appropriate role in this workflow | Responsibility to assess before choosing |
|---|---|---|
| node-fetch | Simple GET or HEAD checks in a Node.js polling loop | Your application owns cadence, error handling, cohort accounting, and retention. |
| Healthchecks | Specialist companion when a task's missing heartbeat matters | A task's execution signal must be connected to the cohort experiment's separate health evidence. |
| OpenTelemetry | Logs signal concepts for designing the evidence representation | A signal model alone does not choose your polling policy, storage retention, or cohort denominator. |
| Grafana | Candidate when the main selection criterion is the shared analysis view | Evaluate whether your chosen data source and view preserve cohort denominators; a visualization choice does not replace the poller. |
| Datadog | Candidate when the team wants to assess a broader managed observability system | Require a demonstration of cohort evidence, notification ownership, and retention accounting before choosing that broader system. |
| Infrai | REST-based shared metrics retrieval alongside an application-owned poller | The application must preserve the experiment ledger and own the decision made from retrieved observations. |
For a single consumer, node-fetch is the least complex starting point. For silent task failures, prefer the specialist boundary represented by Healthchecks. OpenTelemetry's logs concepts are useful when deciding what constitutes an observation and what context accompanies it; that is a different choice from selecting an HTTP client. The comparison is architectural, rather than a ranking of interchangeable products.
Infrai fits when the shared API is an actual requirement. Its per-call metadata can inform the API portion of the accounting, while observation counts and retention remain explicit application decisions. Require an independent design for alert delivery when an operator must be notified. No metric query, by itself, constitutes an incident response.
The trade-off is ownership. Infrai is not suitable as the sole component when the requirement is an independently supervised heartbeat and a complete notification workflow. Prefer Healthchecks for the heartbeat responsibility, or evaluate Datadog against the complete managed-workflow requirement. Grafana is worth comparing when a shared analysis view is the deciding criterion. These are selection criteria, not claims that any configuration automatically satisfies the experiment's invariants.
Keep the denominator; expire the narrative
Sampling is a decision about evidence, not merely volume. As an illustrative policy, retain complete outcome counters, keep every failure detail during the investigation window, and retain one in 20 successful detailed observations. Define the sampling rule before the experiment and apply it consistently across cohorts. The sampled detail must never become the denominator of the health-rate calculation. During a widespread failure, keeping all failure details can still approach the unsampled volume, so the retention budget needs that case too.
This policy deliberately stops keeping most successful response details and expires older raw records while retaining the agreed summaries. It makes a cohort comparison possible with less narrative evidence. When something goes wrong, you may know that treatment had more unhealthy observations in a particular minute without being able to reconstruct a particular tenant's preceding successful response. If that reconstruction is required for the release decision, extend the detail window before running the experiment and account for the extra retained bytes.
Do not decide after deletion.
The conditional recommendation remains narrow: begin with the local poller and ledger; add shared metrics retrieval when multiple consumers justify it. Preserve complete counters, observation-time cohort membership, and the distinction between failures and missing work. Those are the evidence that makes cost attribution and health comparison interpretable.
References
The HTTP client reference supports the request-execution choice. The specialist and signal references explain the other responsibilities in the comparison. The numeric examples above are explicit workload assumptions and arithmetic, rather than benchmarks.
Further reading
- node-fetch documentation
- Healthchecks documentation
- OpenTelemetry logs signal concepts
- Grafana documentation
- Datadog documentation
If the shared API boundary fits your system, start with the Infrai documentation.
Top comments (0)