-
Notifications
You must be signed in to change notification settings - Fork 651
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
Make SpanProcessor.on_start accept parent Context #1251
Make SpanProcessor.on_start accept parent Context #1251
Conversation
* context from Tracer.start_span is passed through to the SpanProcessor * fix linting issue in falcon test app when linting with eachdist script * fix global error handler test as it read installed extensions * reset global Configuration object state after tests were run
I understand that this is in the specs but what exactly is it being used for? I don't see the behavior being defined anywhere (or where this parameter is being used) specifically for |
Which behavior do you mean? It is clearly specified what must be in there: https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/sdk.md#OnStart
This is not used in the built-in SDK, but one usage example from Dynatrace is this: We have a custom propagator that reads an additional HTTP header. We set this http header in the returned context. In a custom SpanProcessor we can copy the header from the context to a span attribute, in order to later have it exported. |
This changes the SpanProcessor interface, so it is breaking I think. |
Sorry what I meant was:
If it is not used in the built-in SDK, why define |
Because one purpose of the built-in SDK is to allow users to add custom span processors which might need this parameter 😃
(you mean on_start here, right?) |
Note that Dynatrace is not the only party interested in this, as evident e.g. from open-telemetry/opentelemetry-java#1811 |
Ahh I see that was the confusion. Thanks for the explanation! :) |
@@ -25,7 +25,8 @@ | |||
|
|||
|
|||
class TestErrorHandler(TestCase): | |||
def test_default_error_handler(self): | |||
@patch("opentelemetry.sdk.error_handler.iter_entry_points") |
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.
What's this change for?
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.
when running the test locally with the eachdist
script this test fails. The problem is that there are some entry points already setup when installing a dev environment with eachdist develop
. This test however checkes the default error handler when no error handler entry points are configured.
|
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.
Thanks for the change, lgtm
Co-authored-by: Daniel Dyla <[email protected]>
Description
Adds optional parent
Context
parameter toSpanProcessor.on_start
as per spec.Fixes #1250
Type of change
How Has This Been Tested?
Additional unit tests checking that the parent Context is passed through from tracer.start_span to SpanProcessor.on_start
Checklist: