-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add Flow run OTEL instrumentation #16010
Conversation
…pan processor in tests b/c periodic exports make tests timing dependent.
@@ -560,6 +563,11 @@ class FlowRun(ObjectBaseModel): | |||
description="A list of tags on the flow run", | |||
examples=[["tag-1", "tag-2"]], | |||
) | |||
labels: KeyValueLabels = Field( | |||
default_factory=dict, | |||
description="Prefect Cloud: A dictionary of key-value labels. Values can be strings, numbers, or booleans.", |
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.
labels are only available via cloud atm so adding them onto client schema here with a default dict to populate for non-cloud server responses so that they're available to be serialized as span attrs
CodSpeed Performance ReportMerging #16010 will not alter performanceComparing Summary
|
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.
looks great!
This PR adds OTEL instrumentation into the flow run engine so that if a user were to configure application-level telemetry, the flow run engine will now emit spans for flow runs that capture metadata about the flow run in span attributes and state changes as events on the span. Note: this PR does not include task run instrumentations but will extensibly nest spans (that can/will be emitted from tasks) transparently.
What impact will this have if I do not have telemetry configured?
https://opentelemetry.io/docs/concepts/instrumentation/libraries/#performance
This PR also sets up some testing infrastructure for testing otel instrumentation - heavily borrowing from
opentelemetry.test.test_base import TestBase
which many instrumentation libs in opentelemetry-python-contrib seem to use (i.e. httpx) but moved over in a more pytest-friendly interface here.Closes CLOUD-564
Checklist
<link to issue>
"mint.json
.