⚡ Signal Lab
Trigger real API calls, generate traces, emit logs, and produce errors — all wired to Datadog APM, RUM, and Logs via the Vercel log drain.
Health Check
ReadyGET /api/lab/health — basic liveness check with trace.
Env Info
ReadyGET /api/lab/env-info — safe Vercel env snapshot.
CMS Fetch
ReadyGET /api/lab/cms-fetch — fetch latest posts from Sanity.
Slow Query
ReadyArtificial delay to trigger latency traces.
Chain (3 hops)
ReadyChained fetch through /api/lab/health × 3.
Lead Capture
ReadyPOST /api/lab/lead-capture — validates and logs a form submission.
Search Posts
ReadyGET /api/lab/campaign-search?q= — Sanity GROQ search.
Outbound Proxy
ReadyPOST /api/lab/proxy — fetch an external URL through the server.
Log Burst
ReadyPOST /api/lab/log-burst — emit N structured log lines.
Custom Attribute
ReadyPOST /api/lab/custom-attribute — set a span attribute.
Direct OTLP Test
ReadyGET /api/lab/otel-direct — sends a trace, log, and metric directly to Datadog's OTLP intake (and the Vercel sidecar if available). On Vercel uses vercel.integrations.otlp.* endpoint; locally falls back to otlp.* with dd-otlp-source.
Direct OTLP Log
ReadyPOST /api/lab/otlp-logs — send a log directly to Datadog's OTLP logs endpoint, bypassing the Vercel drain. Requires DATADOG_API_KEY.
Runtime Metrics Snapshot
ReadyGET /api/lab/runtime-metrics — snapshots heap, RSS, CPU, and uptime, then emits them as OTel gauges. Works alongside background RuntimeNodeInstrumentation metrics.
Lambda Runtime Probe
ReadyGET /api/lab/lambda-context — reads AWS_LAMBDA_METADATA_API to surface function ARN, X-Ray trace ID, and invocation metadata via the Extensions and Runtime APIs.
Environment Inspector
ReadyPOST /api/lab/debug-env — requires DEBUG_SECRET passcode. Sensitive keys are redacted.
Handled errors are caught and returned as 500 JSON. Unhandled errors throw and let Next.js produce the 500 — both set OTel span attributes for Datadog Error Tracking.
Handled
Generic Error
ReadyGET /api/lab/handled-error — basic Error class, caught and logged.
TypeError — Null Access
ReadyGET /api/lab/error/type-error — accesses a property on null.
SyntaxError — Bad JSON
ReadyGET /api/lab/error/syntax-error — JSON.parse on a malformed string.
Custom Error Class
ReadyGET /api/lab/error/custom-error — DatabaseConnectionError with code + host attributes.
RangeError — Stack Overflow
ReadyGET /api/lab/error/range-error — infinite recursion, tests truncated stack capture.
Async Error with Cause
ReadyGET /api/lab/error/async-error — async rejection wrapped with error cause chain.
Unhandled
Generic Unhandled
ReadyGET /api/lab/unhandled-error — throws a plain Error, no catch.
Unhandled TypeError
ReadyGET /api/lab/error/unhandled-type-error — throws a TypeError, tests grouping by error.type.
Unhandled Custom Error
ReadyGET /api/lab/error/unhandled-custom-error — throws UpstreamServiceError with upstream.service + status_code attributes.