-
Notifications
You must be signed in to change notification settings - Fork 628
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
Added support for traceresponse headers #436
Added support for traceresponse headers #436
Conversation
72589a6
to
10ea879
Compare
I created individual PRs first but they were very repetitive and quite small. I thought it'd be better to have them bundled as a single PR. This way they can be reviewed at once by the same reviewers. It should be more efficient I think. |
4028808
to
f453f21
Compare
@@ -273,5 +279,9 @@ def process_response( | |||
) | |||
) | |||
|
|||
propagator = get_global_response_propagator() | |||
if propagator: | |||
propagator.inject(resp, setter=self.back_propagation_setter) |
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.
You are able to access a class attribute like this via self
?
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.
Yes but it can lead to bugs later. Will change.
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.
LGTM
@@ -264,3 +264,11 @@ def _end_span_after_iterating(iterable, span, tracer, token): | |||
close() | |||
span.end() | |||
context.detach(token) | |||
|
|||
|
|||
class BackPropagationSetter: |
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.
Inherit from Setter
4bf4ec0
to
9f33735
Compare
After sub-classing, docs job is failing with:
The core repo GIT SHA was updated to tip of core main which contains the change. The file for which docs are being generated is obviously able to import the said class as it passes all tests and lint checks. I tried invalidating tox cache but it isn't helping either. Looks like docs job is not installing the latest core main or is not using the locally checked out copy for some reason. |
9f33735
to
c0afe1d
Compare
…umentations. This allows users to configure their web apps to inject trace context as headers in HTTP responses. This is useful when client side apps need to connect their spans with the server side spans e.g, in RUM products. Today the most practical way to do this is to use the Server-Timing header but in near future we might use the traceresponse header as described here: https://w3c.github.io/trace-context/#trace-context-http-response-headers-format Added trace response propagation support for: Django Falcon Flask Pyramid Tornado
c0afe1d
to
9a710fb
Compare
@lzchen I'm at a loss. I'm reverting inheriting from ABC setter for now and added a TODO to unblock release for now. Will need more time to figure out why docs doesn't like it. I remember Srikanth had a similar issue last week so probably something is wrong with docs tox job that we need to look into anyway. |
@owais |
This asgi version is modeled after the original wsgi version in open-telemetry#436.
This asgi version is modeled after the original wsgi version in open-telemetry#436.
This asgi version is modeled after the original wsgi version in open-telemetry#436.
This asgi version is modeled after the original wsgi version in open-telemetry#436 and corresponds to the SERVER span. Also cleans up some of the existing ASGI functionality to reduce complexity and make future contributions more straightforward.
This asgi version is modeled after the original wsgi version in #436 and corresponds to the SERVER span. Also cleans up some of the existing ASGI functionality to reduce complexity and make future contributions more straightforward.
Description
Added opt-in support to return traceresponse headers for server instrumentations.
This allows users to configure their web apps to inject trace context
as headers in HTTP responses. This is useful when client side apps need
to connect their spans with the server side spans e.g, in RUM products.
Today the most practical way to do this is to use the
Server-Timing
header but in near future we might use the
traceresponse
header asdescribed here: https://w3c.github.io/trace-context/#trace-context-http-response-headers-format
Added trace response propagation support for:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.