feat: dist tracing 4 (#25574)
* feat: distributed tracing 2 * feat: distributed tracing 2 * refactor: feedback * refactor: feedback * fix: type error * fix: trpc error * feat: distributed tracing - 3 * chore: translation * refactor: improvements * fix: feedback * chore: remove * feat: dist tracing 4 * fix: type errors * fix: type errors * fix: remove string type * fix: type errors
This commit is contained in:
1 parent
0d4108dd69
commit
4e1d05a7e7
15 files changed
+127
-26
No files matched your search
@@ -20,6 +20,7 @@ import { parseRecurringEvent } from "@calcom/lib/isRecurringEvent";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { PrismaOrgMembershipRepository } from "@calcom/lib/server/repository/PrismaOrgMembershipRepository";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import type { TraceContext } from "@calcom/lib/tracing";
|
||||
import { prisma } from "@calcom/prisma";
|
||||
import { Prisma } from "@calcom/prisma/client";
|
||||
import {
|
||||
@@ -41,6 +42,7 @@ import type { TConfirmInputSchema } from "./confirm.schema";
|
||||
type ConfirmOptions = {
|
||||
ctx: {
|
||||
user: Pick<NonNullable<TrpcSessionUser>, "id" | "uuid" | "email" | "username" | "role" | "destinationCalendar">;
|
||||
traceContext: TraceContext;
|
||||
};
|
||||
input: TConfirmInputSchema;
|
||||
};
|
||||
@@ -277,6 +279,15 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
const traceContext = {
|
||||
...ctx.traceContext,
|
||||
bookingUid: booking.uid || "unknown",
|
||||
confirmed: String(confirmed),
|
||||
eventTypeId: booking.eventType?.id?.toString() || "null",
|
||||
userId: user.id.toString(),
|
||||
teamId: booking.eventType?.teamId?.toString() || "null",
|
||||
};
|
||||
|
||||
if (recurringEventId && recurringEvent) {
|
||||
const groupedRecurringBookings = await prisma.booking.groupBy({
|
||||
where: {
|
||||
@@ -307,6 +318,7 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
|
||||
(booking.eventType?.locations as LocationObject[]) || []
|
||||
);
|
||||
evt.conferenceCredentialId = conferenceCredentialId.conferenceCredentialId;
|
||||
|
||||
await handleConfirmation({
|
||||
user: { ...user, credentials: allCredentials },
|
||||
evt,
|
||||
@@ -316,6 +328,7 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
|
||||
booking,
|
||||
emailsEnabled,
|
||||
platformClientParams,
|
||||
traceContext,
|
||||
});
|
||||
} else {
|
||||
evt.rejectionReason = rejectionReason;
|
||||
@@ -392,7 +405,7 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
|
||||
status: BookingStatus.REJECTED,
|
||||
smsReminderNumber: booking.smsReminderNumber || undefined,
|
||||
};
|
||||
await handleWebhookTrigger({ subscriberOptions, eventTrigger, webhookData });
|
||||
await handleWebhookTrigger({ subscriberOptions, eventTrigger, webhookData, traceContext });
|
||||
|
||||
const workflows = await getAllWorkflowsFromEventType(booking.eventType, user.id);
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user