Repository navigation
fix(observability): make Datadog optional without production outage - #554
Conversation
This comment has been minimized.
This comment has been minimized.
|
@kody start-review |
| Autofix run https://github.com/Simple-With-Us/DealDex/actions/runs/41366841684 started for `sentry[bot]`'s tagged request. Owner/sentry request: exempt from the per-bot cap (owner rule 2026-10-20). |
This comment has been minimized.
This comment has been minimized.
|
@kody start-review |
This comment has been minimized.
This comment has been minimized.
|
@kody start-review |
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀
|
| Options | Enabled |
|---|---|
| Bug | ✅ |
| Performance | ✅ |
| Security | ✅ |
| Business Logic | ✅ |
Summary
503.DD_REQUIRE=1mode that restores the previous fail-closed behavior: requests are rejected with503whenDD_API_KEYorDATADOG_API_KEYis missing, and the application handler is not invoked.Test Coverage
503, and application errors are propagated.Outstanding Review Findings
npm testto fail until that expectation is updated..tspath that TypeScript rejects withoutallowImportingTsExtensions; the import must be adjusted for the project’s compiler configuration.Summary
DD_*credentials are not configured, preventing missing configuration from disrupting application traffic.DD_REQUIRE=1: production requests receive HTTP 503 without invoking the application.Summary
Makes Datadog an optional production dependency by default while preserving strict enforcement for environments that explicitly opt in.
Changes
DD_REQUIRE=1is configured.DD_API_KEYreturns HTTP 503 without invoking the application handler.Impact
Production deployments without Datadog credentials can continue serving traffic instead of failing because observability is not configured. Deployments that deliberately set
DD_REQUIRE=1continue to enforce Datadog availability and return a 503 when the required server credentials are absent.Summary
Makes Datadog observability optional by default in production to prevent outages when server keys are missing.
Fail-closed behavior (reporting missing
DD_API_KEY) now only applies when explicitly required viaDD_REQUIRE=1, instead of automatically failing in all production environments.Changes
DD_*keys stays dark instead of throwing / blocking.VERCEL_ENV=production+DD_REQUIRE=1and no API key, missing keys are still reported and middleware returns 503 without invoking the app.config.test.tsandmiddleware.test.tswith no behavior change.Impact
Production deploys without Datadog credentials continue to serve traffic normally with observability disabled, while teams can still enforce required observability by setting
DD_REQUIRE=1.