* Add http.server.response.size metric to ASGI implementation.
Add new unit tests.
* Update changelog.
* Fix linting by disabling too-many-nested-blocks
* Put new logic in a new method
* Refactor the placement of new logic.
* Fixed the unit tests in FastAPI and Starlette
* Update changelog.
* FIx lint errors.
* Refactor getting content-length header
* Refactor getting content-length header
---------
Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
* code change to add custom http and websocket request and response headers as span attributes. Issue: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/919
* adding entry to changelog
* changes after running "tox -e generate" locally
* - added server_span.is_recording() in _get_otel_send() just to make sure the span is recording before adding the attributes to span.
- changed span to current_span to make sure attributes are being added to proper span.
* removed commented code
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
* adding unit test case for ASGI framework for application wrapped with another framework
* resolving lint errors
* resolving generate build errors
* resolving flake errors
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
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.
* Refactor code using pyupgrade for Python 3.6
This diff is the result of applying the following command to the
project:
```shell
find . -type f -name "*.py" -exec pyupgrade --py36-plus '{}' +
```
* Simplify yield from