feat: add run_id to telemetry payloads#10105
Conversation
* Introduced run_id to RunPayload, PlaygroundPayload, and ComponentPayload to facilitate better tracking of individual runs and components in telemetry data.
* Added run_id field to the telemetry payloads in create_response for both success and error cases, aligning with the OpenAI endpoint's requirements for enhanced tracking.
* Added run_id parameter to simple_run_flow and related functions to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability. * Refactored error handling in webhook_run_flow to maintain consistent telemetry logging.
* Added run_id generation and integration into the retrieve_vertices_order and build_vertex functions to improve telemetry tracking. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow executions.
…low_events * Added run_id generation and integration into the generate_flow_events function to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored log_telemetry function to accept run_id as a parameter for consistent logging across different execution paths.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds a run_id across build, chat, endpoints, and OpenAI response paths. Propagates run_id through Graph (via set_run_id), telemetry payloads (RunPayload, PlaygroundPayload, ComponentPayload), and responses. Updates function signatures to accept/pass run_id and extends telemetry schemas with new optional IDs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant API as Endpoints
participant Graph
participant Worker as Background Task
participant Telemetry
Note over API,Graph: Flow run (non-webhook)
Client->>API: simple_run_flow(request)
API->>API: run_id = uuid() if None
API->>Graph: set_run_id(run_id)
alt stream=false
API->>Graph: execute(...)
Graph-->>API: result or error
API->>Telemetry: RunPayload{run_id, status}
API-->>Client: response
else stream=true (background)
API->>Worker: simple_run_flow_task(..., run_id)
Worker->>Graph: execute(...)
alt success
Worker->>Telemetry: RunPayload{run_id, status=success}
else error
Worker->>Telemetry: RunPayload{run_id, status=error}
end
API-->>Client: accepted/stream handle
end
sequenceDiagram
autonumber
participant Caller
participant BuildAPI as build.py
participant ChatAPI as v1/chat.py
participant Graph
participant Telemetry
Note over BuildAPI,Graph: Build graph and order vertices
Caller->>BuildAPI: build_graph_and_get_order()
BuildAPI->>BuildAPI: run_id = uuid()
BuildAPI->>Graph: set_run_id(run_id)
BuildAPI->>Graph: construct/build
alt per-component success/error
Graph-->>BuildAPI: component result/error
BuildAPI->>Telemetry: ComponentPayload{component_run_id=run_id}
end
BuildAPI->>Telemetry: PlaygroundPayload{playground_run_id=run_id, status}
BuildAPI-->>Caller: order
Note over ChatAPI,Graph: Retrieve vertices order
Caller->>ChatAPI: retrieve_vertices_order()
ChatAPI->>ChatAPI: run_id = uuid()
ChatAPI->>Graph: set_run_id(run_id)
ChatAPI->>Graph: plan/retrieve
ChatAPI->>Telemetry: PlaygroundPayload{playground_run_id=run_id, status}
ChatAPI-->>Caller: VerticesOrderResponse{run_id}
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches❌ Failed checks (1 error, 2 warnings, 1 inconclusive)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (48.63%) is below the target coverage (55.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #10105 +/- ##
==========================================
+ Coverage 24.73% 24.80% +0.07%
==========================================
Files 1090 1087 -3
Lines 40116 40032 -84
Branches 5550 5524 -26
==========================================
+ Hits 9921 9929 +8
+ Misses 30024 29932 -92
Partials 171 171
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
* Updated test assertions to validate the inclusion of run_id as None in the serialized output, aligning with the latest telemetry structure.
| from http import HTTPStatus | ||
| from typing import TYPE_CHECKING, Annotated | ||
| from uuid import UUID | ||
| from uuid import UUID, uuid4 |
There was a problem hiding this comment.
NIT: Maybe we can import uuid and use uuid.uuid4() as is done in the rest of the PR, just for consistency? (hardly matters, but might look cleaner)
There was a problem hiding this comment.
I agree with this too
erichare
left a comment
There was a problem hiding this comment.
LGTM! Awesome addition
* Added run_id generation and integration into the build_vertex function to enhance telemetry tracking of component executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored error handling to maintain consistent logging of run_id across different execution paths.
|
* feat: Add run_id fields to telemetry payloads for enhanced tracking * Introduced run_id to RunPayload, PlaygroundPayload, and ComponentPayload to facilitate better tracking of individual runs and components in telemetry data. * fix: Update create_response to include run_id in telemetry payloads * Added run_id field to the telemetry payloads in create_response for both success and error cases, aligning with the OpenAI endpoint's requirements for enhanced tracking. * feat: Enhance flow execution with run_id for telemetry tracking * Added run_id parameter to simple_run_flow and related functions to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability. * Refactored error handling in webhook_run_flow to maintain consistent telemetry logging. * feat: Integrate run_id into telemetry for enhanced tracking in chat flow * Added run_id generation and integration into the retrieve_vertices_order and build_vertex functions to improve telemetry tracking. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow executions. * feat: Enhance telemetry logging with run_id integration in generate_flow_events * Added run_id generation and integration into the generate_flow_events function to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored log_telemetry function to accept run_id as a parameter for consistent logging across different execution paths. * tests: Add run_id fields to telemetry payloads in integration tests * Updated test assertions to validate the inclusion of run_id as None in the serialized output, aligning with the latest telemetry structure. * feat: Integrate run_id into build_vertex for improved telemetry tracking * Added run_id generation and integration into the build_vertex function to enhance telemetry tracking of component executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored error handling to maintain consistent logging of run_id across different execution paths. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: Add run_id fields to telemetry payloads for enhanced tracking * Introduced run_id to RunPayload, PlaygroundPayload, and ComponentPayload to facilitate better tracking of individual runs and components in telemetry data. * fix: Update create_response to include run_id in telemetry payloads * Added run_id field to the telemetry payloads in create_response for both success and error cases, aligning with the OpenAI endpoint's requirements for enhanced tracking. * feat: Enhance flow execution with run_id for telemetry tracking * Added run_id parameter to simple_run_flow and related functions to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability. * Refactored error handling in webhook_run_flow to maintain consistent telemetry logging. * feat: Integrate run_id into telemetry for enhanced tracking in chat flow * Added run_id generation and integration into the retrieve_vertices_order and build_vertex functions to improve telemetry tracking. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow executions. * feat: Enhance telemetry logging with run_id integration in generate_flow_events * Added run_id generation and integration into the generate_flow_events function to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored log_telemetry function to accept run_id as a parameter for consistent logging across different execution paths. * tests: Add run_id fields to telemetry payloads in integration tests * Updated test assertions to validate the inclusion of run_id as None in the serialized output, aligning with the latest telemetry structure. * feat: Integrate run_id into build_vertex for improved telemetry tracking * Added run_id generation and integration into the build_vertex function to enhance telemetry tracking of component executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored error handling to maintain consistent logging of run_id across different execution paths. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: Add run_id fields to telemetry payloads for enhanced tracking * Introduced run_id to RunPayload, PlaygroundPayload, and ComponentPayload to facilitate better tracking of individual runs and components in telemetry data. * fix: Update create_response to include run_id in telemetry payloads * Added run_id field to the telemetry payloads in create_response for both success and error cases, aligning with the OpenAI endpoint's requirements for enhanced tracking. * feat: Enhance flow execution with run_id for telemetry tracking * Added run_id parameter to simple_run_flow and related functions to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability. * Refactored error handling in webhook_run_flow to maintain consistent telemetry logging. * feat: Integrate run_id into telemetry for enhanced tracking in chat flow * Added run_id generation and integration into the retrieve_vertices_order and build_vertex functions to improve telemetry tracking. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow executions. * feat: Enhance telemetry logging with run_id integration in generate_flow_events * Added run_id generation and integration into the generate_flow_events function to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored log_telemetry function to accept run_id as a parameter for consistent logging across different execution paths. * tests: Add run_id fields to telemetry payloads in integration tests * Updated test assertions to validate the inclusion of run_id as None in the serialized output, aligning with the latest telemetry structure. * feat: Integrate run_id into build_vertex for improved telemetry tracking * Added run_id generation and integration into the build_vertex function to enhance telemetry tracking of component executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored error handling to maintain consistent logging of run_id across different execution paths. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: Add run_id fields to telemetry payloads for enhanced tracking * Introduced run_id to RunPayload, PlaygroundPayload, and ComponentPayload to facilitate better tracking of individual runs and components in telemetry data. * fix: Update create_response to include run_id in telemetry payloads * Added run_id field to the telemetry payloads in create_response for both success and error cases, aligning with the OpenAI endpoint's requirements for enhanced tracking. * feat: Enhance flow execution with run_id for telemetry tracking * Added run_id parameter to simple_run_flow and related functions to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability. * Refactored error handling in webhook_run_flow to maintain consistent telemetry logging. * feat: Integrate run_id into telemetry for enhanced tracking in chat flow * Added run_id generation and integration into the retrieve_vertices_order and build_vertex functions to improve telemetry tracking. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow executions. * feat: Enhance telemetry logging with run_id integration in generate_flow_events * Added run_id generation and integration into the generate_flow_events function to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored log_telemetry function to accept run_id as a parameter for consistent logging across different execution paths. * tests: Add run_id fields to telemetry payloads in integration tests * Updated test assertions to validate the inclusion of run_id as None in the serialized output, aligning with the latest telemetry structure. * feat: Integrate run_id into build_vertex for improved telemetry tracking * Added run_id generation and integration into the build_vertex function to enhance telemetry tracking of component executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored error handling to maintain consistent logging of run_id across different execution paths. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: Add run_id fields to telemetry payloads for enhanced tracking * Introduced run_id to RunPayload, PlaygroundPayload, and ComponentPayload to facilitate better tracking of individual runs and components in telemetry data. * fix: Update create_response to include run_id in telemetry payloads * Added run_id field to the telemetry payloads in create_response for both success and error cases, aligning with the OpenAI endpoint's requirements for enhanced tracking. * feat: Enhance flow execution with run_id for telemetry tracking * Added run_id parameter to simple_run_flow and related functions to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability. * Refactored error handling in webhook_run_flow to maintain consistent telemetry logging. * feat: Integrate run_id into telemetry for enhanced tracking in chat flow * Added run_id generation and integration into the retrieve_vertices_order and build_vertex functions to improve telemetry tracking. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow executions. * feat: Enhance telemetry logging with run_id integration in generate_flow_events * Added run_id generation and integration into the generate_flow_events function to improve tracking of flow executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored log_telemetry function to accept run_id as a parameter for consistent logging across different execution paths. * tests: Add run_id fields to telemetry payloads in integration tests * Updated test assertions to validate the inclusion of run_id as None in the serialized output, aligning with the latest telemetry structure. * feat: Integrate run_id into build_vertex for improved telemetry tracking * Added run_id generation and integration into the build_vertex function to enhance telemetry tracking of component executions. * Updated telemetry logging to include run_id for both successful and failed executions, ensuring better traceability of flow events. * Refactored error handling to maintain consistent logging of run_id across different execution paths. * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) --------- Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>



Summary by CodeRabbit
New Features
Chores