History

chore(cloud): remove /api/debug/boom smoke-test endpoint

Used to verify the otel-cf-workers + Effect wiring end-to-end. No longer needed now that spans are confirmed landing in Axiom.

Rhys Sullivan committed 6 months ago

Commit 2f7def31 parent 28d8ece1 file · +0 −22Browse files

Unified · Split

apps/cloud/src/start.ts+0−22
@@ -1,9 +1,7 @@
11 import { env } from "cloudflare:workers";
22 import { createMiddleware, createStart } from "@tanstack/react-start";
3−import { Effect } from "effect";
43 import { handleApiRequest } from "./api";
54 import { handleMcpRequest } from "./mcp";
6−import { TelemetryLive } from "./services/telemetry";
75
86 // ---------------------------------------------------------------------------
97 // Marketing routes — proxied to the marketing worker via service binding
@@ -107,25 +105,6 @@ const sentryTunnelMiddleware = createMiddleware({ type: "request" }).server( · 97 unmodified lines
107105 },
108106 );
109107
110−// ---------------------------------------------------------------------------
111−// Debug middleware — /api/debug/boom triggers an Effect span + throw so we
112−// can verify traces hit Axiom and errors hit Sentry. Safe to leave in prod
113−// since it's gated on an exact path match and only ever fails.
114−// ---------------------------------------------------------------------------
115−
116−const debugBoomMiddleware = createMiddleware({ type: "request" }).server(
117− async ({ pathname, next }) => {
118− if (pathname !== "/api/debug/boom") return next();
119− const program = Effect.gen(function* () {
120− yield* Effect.logInfo("debug boom: about to throw");
121− yield* Effect.sync(() => {
122− throw new Error("debug boom: telemetry smoke test");
123− });
124− }).pipe(Effect.withSpan("debug.boom"), Effect.provide(TelemetryLive));
125− return Effect.runPromise(program) as unknown as Response;
126− },
127−);
128−
129108 // ---------------------------------------------------------------------------
130109 // API middleware — routes /api/* to the Effect HTTP layer
131110 // ---------------------------------------------------------------------------
@@ -146,7 +125,6 @@ export const startInstance = createStart(() => ({ · 14 unmodified lines
146125 marketingMiddleware,
147126 mcpRequestMiddleware,
148127 sentryTunnelMiddleware,
149− debugBoomMiddleware,
150128 apiRequestMiddleware,
151129 ],
152130 }));