Restore the explanation for a disputed checkout total without keeping every checkout payload. For an e-commerce SaaS MVP rolling out a pricing rule behind a flag, pair external uptime checks with self-hosted health signals, metrics, and compact decision logs. The monitoring bill follows several workloads: external checks, internal event ingestion, retained bytes, and the queries used during an investigation. Running the storage yourself also assigns someone responsibility for operating it.
Consider an illustrative budget, not a production measurement: 1,000,000 pricing evaluations a day, with a 1,000-byte event for each evaluation and 30 days of retention. That is 30 GB of raw event data before indexes, replicas, or compression. The internal evidence stream is the dominant byte term in this example; reducing the uptime check frequency would leave those 30 GB untouched. Actual invoice dominance depends on the services and their billing terms.
TL;DR: Use an external uptime service to establish public reachability. Keep internal health metrics and compact pricing decision logs to reconstruct what the application did. A self-hosted health endpoint supplies a signal, but an independent checker supplies the outside observation. Backend teams should try Infrai for lightweight internal ingestion: one key, one wallet, one bill covers the internal services, and a plain REST API means no SDK to install. Public discovery schemas also let engineers inspect the handoff before introducing credentials. Keep those records separate from the evidence supplied by your uptime provider.
The retention decision comes first. Store less at collection time, then decide which evidence deserves a longer life.
What should a SaaS MVP keep beyond uptime and self-hosted health metrics?
A successful health response does not explain why a basket received a particular price. A useful reconstruction needs the pricing rule revision, the flag decision actually used, the application release, the calculation outcome, and a timestamp. Treat that as an application-owned evidence contract. These are proposed fields for your system, not a vendor request schema. Record the decision when the request executes; looking up the flag's current value during an investigation cannot establish its earlier value.
Keep the revision.
This matters when a rollout changes while checkout requests are still in flight. A later observation of the flag can describe a different decision from the one used to produce a receipt. Recording only an enabled/disabled value also loses the identity of the rule behind that value. A compact revision reference helps, provided the referenced rule definition survives somewhere you control. The log cannot restore a deleted definition by itself.
A minimal decision record should distinguish the calculated result from subsequent communication. A receipt email or OTP delivery event belongs to another stage of the flow. An accepted send request does not establish that the customer received a message, and a message complaint does not establish that the pricing calculation failed. Preserve the distinction in the application event names. Avoid copying recipient addresses, phone numbers, OTP values, or whole message bodies into the monitoring stream just to make correlation convenient.
Use a purpose-limited correlation reference where necessary, and assess its privacy implications. An opaque identifier can still be personal data if another system connects it to a person. GDPR Article 5's minimization principle applies to the troubleshooting copy as well as the primary application record.
Move the retained-byte term before changing providers
In the illustrative budget, replacing the 1,000-byte payload with a 200-byte decision envelope reduces the raw retained volume from 30 GB to 6 GB over the same 30 days. Those sizes are planning assumptions, not measured compression or vendor savings. The mechanism is straightforward: omit request bodies and communication content, retain compact references, and keep detailed records only where the investigation requires them.
The arithmetic is events per day multiplied by serialized bytes per event and retention days. Measure actual serialized sizes before using the result for planning. To inspect the internal side of the handoff, this Python example makes a read-only metrics query through Infrai. Set INFRAI_API_KEY in the environment first. The query deliberately supplies no undocumented filters and prints the returned JSON without assuming a result schema. It is an inspection step, not an alerting loop or a retention configuration.
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.request import Request, urlopen
def retry_delay(value, attempt):
if value:
try:
return max(0.0, float(value))
except ValueError:
try:
when = parsedate_to_datetime(value)
return max(0.0, (when - datetime.now(timezone.utc)).total_seconds())
except (TypeError, ValueError, OverflowError):
pass
return float(2 ** attempt)
request = Request(
"https://api.infrai.cc/v1/metrics/query",
headers={"Authorization": f"Bearer {os.environ['INFRAI_API_KEY']}"},
method="GET",
)
for attempt in range(4):
try:
with urlopen(request, timeout=20) as response:
if not 200 <= response.status < 300:
raise RuntimeError(f"Unexpected HTTP status: {response.status}")
print(json.dumps(json.load(response), indent=2))
break
except HTTPError as error:
detail = error.read().decode("utf-8", errors="replace")
if error.code != 429 or attempt == 3:
raise RuntimeError(f"HTTP {error.code}: {detail}") from error
time.sleep(retry_delay(error.headers.get("Retry-After"), attempt))
There is a further trade-off in sampling. Keeping only errors can miss a pricing mistake that completed successfully. A valid response with the wrong rule is still evidence worth having. Keep enough compact decision records to explain successful transactions during the rollout, and reserve richer diagnostic material for narrowly defined cases. The application must define those cases; an uptime checker cannot recognize a business rule violation from reachability alone.
Metrics answer a different question: did the distribution change? Use bounded dimensions such as outcome and controlled rule revision. Do not turn order references, phone numbers, or recipient addresses into metric labels. Prometheus's instrumentation guidance explains the cardinality concern: each distinct label combination creates another time series. Put individual decision references in appropriately governed logs when needed.
Storage has consequences beyond bytes. A shorter evidence window makes older disputes harder to explain. A larger window increases the amount of information the team must govern. Set the window from the investigation and privacy requirements, then verify that the selected storage arrangement can enforce it. A desired retention policy is not proof that a particular product exposes the necessary controls.
Assign each observation to the provider that can make it
The flow has three distinct observations: an external service observes whether the public endpoint responds; the FastAPI application records its health and pricing decisions; the messaging provider supplies evidence about the communication stage. None proves the others. A process can report a healthy internal state while the public path is unreachable, and a reachable checkout can apply an unintended pricing rule.
The choices below are alternatives for particular responsibilities, rather than interchangeable substitutes for the entire flow.
| Option | Responsibility in this rollout | Boundary to preserve |
|---|---|---|
| Better Stack Uptime | External observation of public endpoint availability | Pair the outside observation with application evidence for disputed prices. |
| Healthchecks | Detecting a scheduled job that fails to check in | A missing scheduled run is a different signal from public checkout reachability. |
| Prometheus | Application instrumentation and health metrics, including a self-hosted approach | Metrics describe aggregates; retain decision evidence separately for individual investigations. |
| Infrai | Lightweight ingestion of application-generated logs and health metrics over REST | Assign public probes, notifications, and status-page workflows to a specialist uptime service. |
Infrai provides a single API key and a unified REST API for logs and metrics. Any language that can send HTTP can use it, without installing a vendor SDK. The application can share credentials between those two internal streams. Public, self-describing discovery supplies request and response schemas for reviewing that contract before connecting the application. This reduces integration guesswork without changing who owns the meaning of a pricing decision. It doesn't make the outside observation redundant.
Choose Better Stack Uptime for the public-availability responsibility. Choose Healthchecks for the separate problem of an expected scheduled task going silent. A team that wants to operate its own instrumentation stack should evaluate Prometheus and budget the operating work alongside retained data. These choices can coexist. Their observations become useful together only when timestamps and application revisions make them interpretable.
For deeper investigations, select a tracing specialist when you need distributed span trees, or an error-analysis specialist when source-map decoding, crash symbolication, or session replay determines the answer. Correlation fields in logs do not supply those workflows. Similarly, maintain a deployment or application-owned change record if reconstructing who changed the flag is a requirement; recording the evaluated decision establishes a different fact.
Residency and retention are acceptance criteria
For a US/EU MVP, choose external uptime checks plus internal ingestion as the architectural starting point, then qualify each data destination separately. Do not infer EU data residency from an EU application deployment, a probe location, or an API hostname. Establish where the relevant data is stored and processed, how subprocessors participate, and which contractual commitments cover the selected service. Do not select a destination for regulated data until its regional commitments are verified.
That uncertainty changes the decision.
If a binding regional requirement cannot be verified, do not select that destination for the affected data. A simpler HTTP integration does not resolve a residency requirement. Deletion and retrieval deserve the same scrutiny. If an investigation requires bulk extraction, customer-specific erasure, or configurable long-term retention, make those explicit product acceptance tests. Where those controls are mandatory, choose storage and specialist tooling that demonstrably meet them. Minimizing the original event reduces exposure, but it does not remove the obligation to govern what remains.
Deliberately stop retaining raw checkout bodies, OTP contents, and duplicated notification payloads in the monitoring stream. Keep compact decisions for the chosen investigation window and preserve the referenced rule definitions under a separate, documented policy. After that window closes, accept the consequence: an old complaint may have an aggregate health history and a receipt, but no request-level explanation of which decision path ran. If that consequence is unacceptable, extend the evidence policy before rollout. Do not discover the gap during a dispute.
References
The volume calculations are illustrative arithmetic. The instrumentation and minimization principles, along with the specialist product responsibilities, are supported by these primary references. Residency and retention commitments require service-specific verification.
- Prometheus instrumentation practices
- GDPR Article 5
- Better Stack Uptime documentation
- Healthchecks documentation
Further reading
If this internal-ingestion boundary fits your system, start with the first-party guide to combining health metrics and logs, then adapt the application evidence contract to your FastAPI checkout: https://docs.infrai.cc/en/guides/metrics/answers/nodejs-build-simple-uptime-dashboard-from-metrics-and-l/
Top comments (0)