feat: distributed tracing - 2 (#24861)

* feat: distributed tracing 2

* feat: distributed tracing 2

* refactor: feedback

* refactor: feedback

* fix: type error

* fix: trpc error

---------

Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
Udit TakkarandHariom Balhara authored and GitHub committed 2025-11-13 11:51:54 +00:00
1 parent 19641ffc05
commit 1ff5d57ded
7 files changed
+158 -67

No files matched your search

+5 -2
View File
@@ -10,10 +10,11 @@ import getIP from "@calcom/lib/getIP";
import { piiHasher } from "@calcom/lib/server/PiiHasher";
import { checkCfTurnstileToken } from "@calcom/lib/server/checkCfTurnstileToken";
import { defaultResponder } from "@calcom/lib/server/defaultResponder";
import prisma from "@calcom/prisma";
import type { TraceContext } from "@calcom/lib/tracing";
import { prisma } from "@calcom/prisma";
import { CreationSource } from "@calcom/prisma/enums";
async function handler(req: NextApiRequest & { userId?: number }) {
async function handler(req: NextApiRequest & { userId?: number; traceContext: TraceContext }) {
const userIp = getIP(req);
if (process.env.NEXT_PUBLIC_CLOUDFLARE_USE_TURNSTILE_IN_BOOKER === "1") {
@@ -52,8 +53,10 @@ async function handler(req: NextApiRequest & { userId?: number }) {
userId: session?.user?.id || -1,
hostname: req.headers.host || "",
forcedSlug: req.headers["x-cal-force-slug"] as string | undefined,
traceContext: req.traceContext,
},
});
// const booking = await createBookingThroughFactory();
return booking;