-
Notifications
You must be signed in to change notification settings - Fork 10.4k
feat: Add distributed tracing for booking flow correlation (1) #22186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add distributed tracing for booking flow correlation (1) #22186
Conversation
- Create centralized tracing library with trace context management - Integrate tracing into core booking flow components - Add trace context propagation to webhook scheduling and execution - Enhance payment processing with trace correlation - Add comprehensive debugging examples and Axiom queries - Maintain backward compatibility with existing logging Co-Authored-By: udit@cal.com <udit222001@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ No security or compliance issues detected. Reviewed everything up to 447ee7d. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. Reply to this PR with |
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (07/08/25)1 reviewer was added to this PR based on Keith Williams's automation. |
…g logger - Enhance TraceContext to include event-specific context (eventTypeSlug, userInfo) - Update DistributedTracing.getTracingLogger to include event context in prefix - Replace all loggerWithEventDetails usages with tracingLogger in handleNewBooking.ts - Add traceId to frontend error display for user support - Maintain backward compatibility while improving observability Co-Authored-By: udit@cal.com <udit222001@gmail.com>
…files - Add trace context support to ensureAvailableUsers, validateBookingTimeIsNotOutOfBounds, validateEventLength - Update seated booking reschedule functions to use distributed tracing - Ensure all booking flow components support trace context propagation - Maintain backward compatibility while enhancing observability Co-Authored-By: udit@cal.com <udit222001@gmail.com>
- Update defaultResponder to extract and include traceId in error responses - Add distributed tracing to api/book/event endpoint with trace context - Include traceId in error data when booking API throws exceptions - Enable frontend to display traceId as Reference ID for user support Co-Authored-By: udit@cal.com <udit222001@gmail.com>
- Modified handleNewBooking to merge passed traceContext with additional properties instead of creating new one - Fixed type error in defaultResponder.ts by adding proper type checking for traceId - Ensures same traceId flows through entire booking process as requested by user Co-Authored-By: udit@cal.com <udit222001@gmail.com>
- Add bookingUid and userId to getTracingLogger prefixes for better context - Update createLoggerWithEventDetails to accept existing trace context parameter - Allow reusing existing trace contexts instead of always creating new ones - Maintain same traceId throughout booking flow while adding event-specific details Co-Authored-By: udit@cal.com <udit222001@gmail.com>
Co-Authored-By: udit@cal.com <udit222001@gmail.com>
…tor approach Co-Authored-By: udit@cal.com <udit222001@gmail.com>
ccb4c2b
to
b4639e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cubic found 19 issues across 26 files. Review them in cubic.dev
React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai
to give specific feedback.
packages/features/bookings/lib/handleNewBooking/validateEventLength.ts
Outdated
Show resolved
Hide resolved
packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx
Outdated
Show resolved
Hide resolved
…ipt error Co-Authored-By: udit@cal.com <udit222001@gmail.com>
@@ -409,6 +409,7 @@ export type BookingHandlerInput = { | |||
// These used to come from headers but now we're passing them as params | |||
hostname?: string; | |||
forcedSlug?: string; | |||
traceContext?: TraceContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called by API v1, web app etc. so making it optional for now. In a follow up PR this would also become required after some testing
feat: Add distributed tracing for booking flow correlation
Part of #22969
Follow up:-
distributedTracer
Summary
This PR implements distributed tracing for Cal.com's booking flow to improve observability and debugging capabilities beyond the current per-request ID system. The implementation adds trace context propagation across multiple booking operations including calendar events, payment processing, webhook execution, and scheduled reminders.
Key Changes:
packages/lib/tracing.ts
) - Centralized trace context management with hierarchical spanshandleNewBooking.ts
Benefits over current request ID system:
Review & Testing Checklist for Human
Recommended test plan:
Diagram
Notes
Implementation approach:
Axiom integration:
Link to Devin run: https://app.devin.ai/sessions/d494fd7f104f4339a390e492f94bd47a
Requested by: @Udit-takkar