26 Commits

Author SHA1 Message Date
256d8ce12d Add http.server.request.size for ASGI metric implementation (#1867)
* Update changelog file.

* Update changelog file.

* Add new request.size metric for ASGI middleware.

* Clean-up.

* Refactor try except section.

---------

Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
2023-06-21 23:56:38 +03:00
60753e2a55 Add http.server.response.size metric to ASGI implementation. (#1789)
* 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>
2023-06-19 23:00:59 +03:00
743ac64661 Issue #1757 - Update HTTP server/client instrumentation span names (#1759)
Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-06-16 00:21:05 +02:00
fc547877d3 Remove use of httpbin (#1854) 2023-06-13 10:30:52 +00:00
bc57cc029d fix(asgi-instrumentation): extract target after running the framework (#1461) 2022-12-05 02:00:09 +00:00
9d6ba63e06 Add support for regular expression matching and sanitizing of headers in ASGI. (#1333) 2022-10-24 21:39:11 +05:30
d5369a4431 feat(instrumentation/asgi): add target to metrics (#1323) 2022-10-22 13:29:53 +00:00
c615fa74da Add test for asgi using NoOpTracerProvider (#1367) 2022-10-11 08:11:53 +05:30
cbf005be6f Metric instrumentation asgi (#1197) 2022-08-08 23:27:16 +05:30
b1bf8d4a54 code change to add custom http and websocket request and response hea… (#1004)
* 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>
2022-03-28 19:05:08 -06:00
22cc215c6c [build] bump pylint (#923)
* [build] bump pylint

Fixes #632

* apply lint suggestions

* specify encoding
2022-02-16 17:52:00 -06:00
0431d7b62f adding unit test case for ASGI framework for application wrapped with… (#899)
* 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>
2022-02-03 22:40:03 +05:30
3de29868a9 Add traceresponse headers for asgi apps (FastAPI, Starlette) (#817)
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.
2021-12-25 21:52:28 +00:00
07c52aad38 Refactor code using pyupgrade for Python 3.6 (#770)
* 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
2021-10-24 07:04:06 +05:30
c5c6977584 Add hooks for aiohttp, asgi, starlette, fastAPI, urllib, urllib3 (#576) 2021-07-26 14:34:50 -07:00
5b43a5993d fix missing dep in docs build (#557) 2021-06-30 12:49:45 -07:00
865837f757 Ensure clean http url (#538) 2021-06-11 09:01:52 -07:00
3bb28ab345 Fix ASGI instrumentation default span name (#418) 2021-05-27 16:20:29 -07:00
b6ed679a0c Set status code on ASGI server span (#478) 2021-05-25 08:59:23 -07:00
3ec77360cb Update instrumentations to use tracer_provider for creating tracer if given, otherwise use global tracer provider (#402) 2021-04-28 08:36:37 -07:00
8d0c150b31 Sync with auto generated semantic convention constants (#428) 2021-04-19 23:37:10 -07:00
f0adb23143 Remove 'component' span attribute in instrumentations (#301) 2021-01-29 13:15:26 -08:00
11a06db3d5 Rename "host.port" attribute to "net.host.port" (#242) 2020-12-11 07:55:11 -08:00
3eb27ca466 Return none for Getter if key does not exist (#233) 2020-12-08 08:22:38 -08:00
847418f397 Use is_recording flag in asgi, pyramid, aiohttp instrumentation (#1142) 2020-10-21 21:34:47 -07:00
9fd77371bb Rename web framework packages from "ext" to "instrumentation" (#961) 2020-10-21 21:34:47 -07:00