-
Notifications
You must be signed in to change notification settings - Fork 615
fix: Introduce _get_current_streamed_span() to keep types backwards compatible
#6177
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
Changes from 8 commits
b694764
b4530d0
54280c7
32b8c5a
2e81110
f4d2b93
8d3d3f0
811b05d
5f8835b
9c2ea89
f592690
e0824df
a8adaee
11fe228
faece2f
76467e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ def overload(x: "T") -> "T": | |
| "get_isolation_scope", | ||
| "get_current_scope", | ||
| "get_current_span", | ||
| "get_current_streamed_span", | ||
| "get_traceparent", | ||
| "is_initialized", | ||
| "isolation_scope", | ||
|
|
@@ -422,13 +423,22 @@ def set_measurement(name: str, value: float, unit: "MeasurementUnit" = "") -> No | |
|
|
||
| def get_current_span( | ||
| scope: "Optional[Scope]" = None, | ||
| ) -> "Optional[Union[Span, StreamedSpan]]": | ||
| ) -> "Optional[Span]": | ||
| """ | ||
| Returns the currently active span if there is one running, otherwise `None` | ||
| """ | ||
| return tracing_utils.get_current_span(scope) | ||
|
|
||
|
|
||
| def get_current_streamed_span( | ||
| scope: "Optional[Scope]" = None, | ||
| ) -> "Optional[StreamedSpan]": | ||
| """ | ||
| Returns the currently active streamed span if there is one running, otherwise `None` | ||
| """ | ||
| return tracing_utils.get_current_streamed_span(scope) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd not expose this as a public API function, at least while the functionality is experimental. Maybe we can move this to Would also be good to add more context to the docstring so that users know when this can be used (i.e., only if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that's a great point, it would be best to not expose too much. I've limited the API surface to |
||
|
|
||
|
|
||
|
alexander-alderman-webb marked this conversation as resolved.
Outdated
|
||
| def get_traceparent() -> "Optional[str]": | ||
| """ | ||
| Returns the traceparent either from the active span or from the scope. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.