Skip to content
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

Update flow run instrumentation to use RunTelemetry class #16233

Conversation

jeanluciano
Copy link
Contributor

@jeanluciano jeanluciano commented Dec 5, 2024

This PR refactors the OTEL instrumentation in flow run to use the RunTelemetry class. Other changes:

  • Updates unit tests for flow run instrumentation to test both flow run engines and moves it to test_instrumentation.py
  • Moves context propagation code to RunTelemetry
  • Updates task_engine.py to support newer changes

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.

Copy link

codspeed-hq bot commented Dec 5, 2024

CodSpeed Performance Report

Merging #16233 will not alter performance

Comparing jean/cloud-740-update-flow-run-instrumentation-to-use-runtelemetry-class (9990c40) with main (ea85716)

Summary

✅ 3 untouched benchmarks

@jeanluciano jeanluciano marked this pull request as ready for review December 10, 2024 18:35
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me overall, but I do have one question about if we should be propagating labels from parent task runs in addition to parent flow runs.

Comment on lines +701 to +702
if parent_flow_run_context and parent_flow_run_context.flow_run:
parent_labels = parent_flow_run_context.flow_run.labels
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be getting labels from parent task runs too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a separate PR we will be rewriting which labels gets passed down since the parent span already includes label information, we don't need to include it in each of the child spans and in many cases it could overwrite 'real' data or attributes set by users.

@jeanluciano jeanluciano merged commit dce8eca into main Dec 12, 2024
38 checks passed
@jeanluciano jeanluciano deleted the jean/cloud-740-update-flow-run-instrumentation-to-use-runtelemetry-class branch December 12, 2024 16:52
EmilRex pushed a commit that referenced this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants