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 🙂 |
tammy-baylis-swi
left a comment
There was a problem hiding this comment.
Also Lgtm, nice to see those types in shared ASGI module. We'll get eyes from the maintainers as well.
scope and messagescope 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_hookwill 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.