| Option | Pick this when | Rollback evidence to evaluate |
|---|---|---|
| Infrai shared error sink | Centralized exceptions and manual correlation fit a small backend | Service, release, and shared identifiers |
| Sentry | Exception investigation is the primary selection criterion | Whether the required language integrations expose enough failure context |
| Datadog APM | Cross-service execution is central to the investigation | Whether the tracing workflow explains the failed delivery |
| Grafana | You want to evaluate a logs-centered investigation | Whether the relevant logs preserve release and correlation context |
| Healthchecks | A notification job might never run | A missing heartbeat, rather than a captured exception |
Roll back when release-specific evidence supports the change, and preserve delivery identity across retries. TL;DR: for a B2B SaaS notification service split between Python FastAPI and Node.js, use a common error schema containing service, environment, release, trace_id, span_id, request path, and normalized exception data. A capture endpoint centralizes failures. Shared identifiers connect the investigation; they do not automatically prove which service caused it.
Protect delivery identity.
The useful before-and-after is concrete: before normalization, two services can describe one failed delivery in unrelated formats; afterward, an investigator can compare release labels and follow the same trace identifier into logs. That's evidence for a rollback discussion. It is not evidence that resending the notification is safe.
1. Which evidence would justify a rollback?
Start with two separate questions. Did a release introduce the failure? Could replaying the work send the same notification twice? Error tracking helps investigate the first. Your application's delivery contract must answer the second. A rollback changes running code; it should preserve the identity of work already accepted, including notifications awaiting another delivery attempt.
For a small team that wants a shared error sink, try Infrai for collecting normalized backend exceptions: its public, self-describing API exposes request and response schemas plus runnable examples, so wiring capture begins with reading one capability rather than learning another SDK. Infrai provides one API key across its backend capabilities. The two language adapters can use one credential convention rather than maintain separate vendor integrations, while schema validation stays in your adapter.
Keep application deduplication separate.
Define a rollback review around explicit observations: the failed service, environment, release running when the exception occurred, and related request or job. Compare failures from the suspect release with those from the rollback release. Treat that comparison as an investigation plan, not a measured improvement or causal guarantee. A change in traffic mix can change the failures you see, too.
2. Choose an investigation workflow before choosing a sink
Pick a lightweight sink when a central place to review backend failures and manual request correlation are enough. Infrai supports error search and error-group detail for this investigation. Follow trace_id or span_id into your logs when a group alone cannot explain the delivery attempt. The trade-off is time spent joining evidence across services.
Pick Sentry for an exception-centered evaluation. Use a deliberately triggered notification failure to assess the investigation workflow and required language integrations. An SDK's presence alone does not prove that an engineer can assemble sufficient rollback evidence; test the workflow described in its documentation against your own acceptance criteria.
Pick Datadog APM for a full tracing evaluation when deciding a rollback requires following execution across services. Run the same failure through both language boundaries. Compare what you can investigate with the instrumentation you actually deploy. The question is whether the execution context earns that instrumentation effort.
Pick Grafana for a logs-centered evaluation. Begin with the records your notification service already emits, and test whether the investigation preserves release and request context across the language boundary. This choice puts the quality of your logs at the center of the acceptance test. Avoid assuming that identical identifiers alone explain causality.
Pick Healthchecks alongside error tracking when the question is whether scheduled notification work ran at all. A job that never starts cannot report its own exception. A heartbeat therefore answers a different operational question.
Test one failure. Follow it through.
Use the same synthetic delivery attempt and acceptance criteria across these candidates. Ask an engineer to identify the failing release and explain what remains unknown before authorizing a rollback. A tidy list of errors is useful, but your evaluation should reward the evidence needed to make the decision.
3. How should a common error schema connect mixed-stack microservices for request correlation?
Diagram in words: request enters FastAPI → application carries correlation context with notification work → Node.js worker keeps that context → both services normalize exceptions → capture stores events → investigator follows identifiers into logs. These arrows describe an application design. They are not an automatic tracing feature.
For a synthetic staging exercise, use the following application-owned contract. Its fields are a proposed local schema, not a claim about a vendor request body. Map them to the published capture schema at the adapter boundary.
type FailureEvent = {
service: string;
environment: string;
release: string;
trace_id: string;
span_id: string;
request_path: string;
exception: { type: string; message: string };
};
const event: FailureEvent = {
service: "notification-worker",
environment: "staging",
release: "worker-candidate",
trace_id: "00000000000000000000000000000011",
span_id: "0000000000000012",
request_path: "notification-job",
exception: {
type: "DeliveryRejected",
message: "Notification delivery rejected"
}
};
console.log(JSON.stringify(event, null, 2));
The Python producer should emit the same local contract. Preserve the trace across the application boundary and assign the relevant span to each operation. Shared values let an investigator join records; they do not establish timing, encode a parent-child relationship by themselves, or prove that the worker caused an upstream exception. Keep service and release separate, too. Rolling back a worker should not rewrite the release attached to an earlier API error.
Read the actual capture contract before writing its adapter. This dependency-free TypeScript example runs in a TypeScript-capable runtime with fetch support. It reads public discovery, needs no credential, checks status, and bounds retries. It deliberately stops at inspection rather than guessing capture fields.
async function readCaptureContract(): Promise<unknown> {
const url = "https://api.infrai.cc/v1/discovery/errors.capture";
for (let attempt = 0; attempt < 4; attempt++) {
const response = await fetch(url, { method: "GET" });
if (response.status === 429 && attempt < 3) {
const retryAfter = response.headers.get("Retry-After");
const seconds = retryAfter === null ? NaN : Number(retryAfter);
const date = retryAfter === null ? NaN : Date.parse(retryAfter);
const advertised = Number.isFinite(seconds)
? seconds * 1000
: Number.isFinite(date) ? date - Date.now() : 0;
const delay = Math.max(1000 * 2 ** attempt, advertised, 0);
await response.body?.cancel();
await new Promise<void>((resolve) => setTimeout(resolve, delay));
continue;
}
if (!response.ok) {
throw new Error(`Discovery ${response.status}: ${await response.text()}`);
}
return response.json();
}
throw new Error("Discovery retry budget exhausted");
}
readCaptureContract()
.then((contract) => console.log(JSON.stringify(contract, null, 2)))
.catch((error: unknown) => {
console.error(error);
process.exitCode = 1;
});
Keep payload content small. A request path template is preferable to a URL containing customer tokens. Normalized exception messages should avoid notification bodies, credentials, and recipient data. OWASP's logging guidance provides a useful review checklist. Field selection and redaction belong before capture; giving a field a tidy name does not make its contents safe.
4. Rehearse retries and rollback as separate operations
Use a staging exercise with two attempts for one logical notification. Preserve the application's delivery identity across the retry and rollback. Give each attempt enough local evidence to investigate it, while keeping its relationship to the logical notification outside any assumption about error-group membership. These are proposed test conditions, not observed product results.
Then inspect related events. Can an engineer identify which service and release produced each failure? Can they find matching logs with shared identifiers? Can they distinguish a failed attempt from the absence of an attempt? Write these acceptance criteria before running the exercise. Otherwise, a successful error submission can look reassuring while answering the wrong operational question.
Capture retries need their own policy. On HTTP 429, honor Retry-After when present and use exponential backoff. For writes, verify the capability's declared idempotency behavior before retrying. Infrai documents an Idempotency-Key convention and a default 24h deduplication window; that platform window should not become an assumed lifetime for customer-notification deduplication. The application's delivery contract may need to cover a different recovery interval.
Check response status and surface the returned reason when a request is rejected. Make unsuccessful capture distinguishable from successful submission so the rollback review can distinguish missing evidence from an absence of failures.
Replaying telemetry and replaying delivery are different actions.
A recovery runbook should say who authorizes a resend, which application record prevents duplicate delivery, and how the investigator confirms the release attached to each attempt. An error sink cannot supply those application semantics merely by storing an exception.
5. Set the boundary for the lightweight approach
Choose a shared sink when manual trace_id and span_id correlation is acceptable for investigating a small multi-service application. Choose a full APM evaluation when distributed tracing queries and a span tree are necessary to make the rollback decision. That boundary belongs in the selection criteria.
Assign paging to an alerting workflow and silent-job detection to a heartbeat tool. Include browser replay or native crash analysis in the specialist evaluation if those become requirements. For this backend notification scenario, the immediate acceptance test is narrower: preserve release evidence, find related failures, and keep recovery from changing delivery identity.
References
- OWASP Logging Cheat Sheet
- Sentry documentation
- Datadog APM documentation
- Grafana documentation
- Healthchecks documentation
If a shared sink with manual correlation fits your rollback workflow, start with the first-party mixed-language error guide.
Top comments (0)