-
Notifications
You must be signed in to change notification settings - Fork 629
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
feat(asgi,fastapi,starlette)!: provide both send and receive hooks with scope
and message
#2546
Conversation
|
3336bca
to
eaacb51
Compare
Fixed the linter errors, let's try it again |
...tation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
Show resolved
Hide resolved
Ready for review |
Thank you for submitting this! A couple of asks:
(1) How has this been tested? Does the hook still work the same way to e.g. set span name or attributes? (2) Please could you also create and link a github Issue describing the feature, like how this PR links this issue, especially because this would be a breaking change. |
Sure, thanks for looking into it!
|
Great thanks!
Yes please a copy-paste works 🙂 |
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.
Also Lgtm, nice to see those types in shared ASGI module. We'll get eyes from the maintainers as well.
scope
and message
scope
and message
, resolves #2560
scope
and message
, resolves #2560scope
and message
Done! |
...tation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
Show resolved
Hide resolved
...tation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
Show resolved
Hide resolved
…th `scope` and `message` Currently, a «receive» hook is only provided with `scope`, but not `message`. On contrary, a «send» hook is only provided with `message`, but not `scope`. This change unifies the both hooks and provides them with additional request info. This is a breaking change: - The hooks will now be provided with one more positional argument - `client_request_hook` will be called _after_ `receive()` instead of _before_ `receive()`
Rebased and corrected the changelog |
Description
Currently, a «receive» hook is only provided with
scope
, but notmessage
. On contrary, a «send» hook is only provided withmessage
, but notscope
.This change unifies the both hooks and provides them with additional request info.
This is a breaking change:
client_request_hook
will be called afterreceive()
instead of beforereceive()
Resolves #2560.
Type of change
How Has This Been Tested?
Existing unit tests have been updated.
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.