-
Notifications
You must be signed in to change notification settings - Fork 947
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
[Tracing][Internal] Use otel_trace_id for correlation between line run and otel trace #2553
Conversation
promptflow-tracing test result 12 files 12 suites 3m 47s ⏱️ Results for commit 6950f4f. ♻️ This comment has been updated with latest results. |
a7fcceb
to
771e68c
Compare
promptflow SDK CLI Azure E2E Test Result heta/add-otel-trace-id-in-line-run 4 files 4 suites 3m 59s ⏱️ Results for commit 6950f4f. ♻️ This comment has been updated with latest results. |
Executor E2E Test Result heta/add-otel-trace-id-in-line-run223 tests 221 ✅ 6m 40s ⏱️ Results for commit 6950f4f. ♻️ This comment has been updated with latest results. |
SDK CLI Test Result heta/add-otel-trace-id-in-line-run 12 files 12 suites 48m 15s ⏱️ Results for commit 6950f4f. ♻️ This comment has been updated with latest results. |
Description
Use otel_trace_id for correlation between line run and otel trace.
This pull request primarily focuses on enhancing the traceability of operations in the codebase. The changes involve storing the OpenTelemetry (otel) trace ID in the PromptFlow (pf) trace for correlation. This is achieved by introducing the
OperationContext
class and adding theotel_trace_id
attribute to theFlowRunInfo
class.Here are the key changes:
Traceability enhancements:
src/promptflow-core/promptflow/_core/run_tracker.py
: ImportedOperationContext
class and stored the otel trace ID in pf trace for correlation in the_flow_run_postprocess
method. [1] [2]src/promptflow-core/promptflow/contracts/run_info.py
: Addedotel_trace_id
attribute to theFlowRunInfo
class.src/promptflow-core/promptflow/executor/flow_executor.py
,src/promptflow-tracing/promptflow/tracing/_trace.py
: Stored the otel trace ID in pf trace for correlation in the_exec_inner_with_trace
,wrapped
(async and sync versions) methods. [1] [2] [3]All Promptflow Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines