1356 Commits

Author SHA1 Message Date
0980486f2f Fix compatibility issue aio-pika instrumentation (#2450)
* - fixed compatibility issue in set_channel of span_builder.py
- changed test-requirements-2.txt to use aio-pika==9.0.5
- added test-requirements-3.txt to use aio-pika==9.4.1 (latest atm)
- tox.ini: fixed incorrect commands_pre which would always install test-requirements-2.txt and cause dep installation conflict
- tox.ini: added aio-pika-3 commands

* Add version comment for aio-pika

---------

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2024-04-22 23:53:59 +00:00
5cb4dab364 Use sqlalchemy version in sqlalchemy commenter instead of opentelemetry library version (#2404)
* Use sqlalchemy version in sqlalchemy commenter instead of opentelemetry library version

The SqlAlchemy commenter is currently using the library version in the comment it emits, e.g.:

```
{
  'db_driver': 'psycopg2', 
  'db_framework': 'sqlalchemy:0.45b0'
}
```

We should instead be using the sqlalchemy version here, as SqlCommenter did before

* Fix lint

* Fix lint

* Add CHANGELOG entry

---------

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2024-04-22 18:04:20 -05:00
c644f0d7d5 [boto3sqs] Instrument Session and resource (#2161)
* [boto3sqs] Instrument `Session` and `resource`

This commit addresses the following open issues:

- https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1699
- https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1996

There are four ways to access the SQS API via `boto3`:

- `client = boto3.client("sqs")`
- `client = boto3.Session().client("sqs")`
- `sqs = boto3.resource("sqs")`
- `sqs = boto3.Session().resource("sqs")`

The existing wrapper tied into `boto3.client` to wrap a generated `botocore.client.SQS` class.
The change here covers the three missing initialization methods.

* update changelog

* rename duplicate test methods

* implement uninstrument

* [boto3sqs] Reduce number of wrapper targets

There are actually 6 ways to initialize a boto3 API object.

```py
boto3.client()              # Using default global session
boto3.resource()            # Using default global session
boto3.Session().client()    # Using "re-exported" session.Session
boto3.Session().resource()  # Using "re-exported" session.Session

boto3.session.Session().client()    # Using session.Session directly
boto3.session.Session().resource()  # Using session.Session directly
```

We only have to patch `session.Session.client` to catch all the cases.

- b3c158c62a/boto3/session.py (L217-L229)
- b3c158c62a/boto3/session.py (L446-L457)

* Remove unused import

---------

Co-authored-by: Matt Oberle <mattoberle@users.noreply.github.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2024-04-22 22:44:31 +00:00
2718ffc7a7 Fix elasticsearch test requirements file name (#2443)
Fixes #2442

Co-authored-by: Leighton Chen <lechen@microsoft.com>
2024-04-22 13:48:51 -05:00
7f4853ac79 fix: revert modifications to Apache license (#2429)
* fix: revert modifications to Apache license

See open-telemetry/community#2056 for background

* path all LICENSE files

Signed-off-by: svrnm <neumanns@cisco.com>

* Fix missing LICENSE files

---------

Signed-off-by: svrnm <neumanns@cisco.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2024-04-22 13:23:38 -05:00
ad06e7043c feat(pika): adding support for channel.consume instrumentation (#2397)
* feat(pika): adding support for channel.consume instrumentation

* updated changelog

* wip tests

* updating docs

* more tests

* removing span member on object proxy

* adding test for ReadyMessagesDequeProxy

* adding tests

* better comment on span.end()

* fixing docs

* ending span even on exceptions
2024-04-21 14:11:39 +03:00
2317adcc34 HTTP transition for wsgi (#2425) 2024-04-19 10:59:05 -07:00
7656bdb8fe fix(grpc): aio grpc client interceptor incorrect metadata handling (#2363) 2024-04-18 11:33:42 -07:00
4de0e5659d elasticsearch: stop testing on ancient versions (#2422)
Pick 6.0 as the baseline.
2024-04-18 08:57:26 -05:00
9ce1c26d27 django: Bump django version to latest (#2427) 2024-04-17 11:19:34 -07:00
82b07959a9 fix: instrumentation-celery test tasks CustomError (#2416)
* fix: instrumentation-celery test tasks CustomError

* chore: lint

---------

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2024-04-17 11:48:09 -05:00
07318bd378 Change AwsLambdaInstrumentor span attrs to meet faas semconv (#2372) 2024-04-17 09:09:55 -07:00
99678ccd3a Add section for semantic convention status for instrumentations (#2433) 2024-04-16 14:04:17 -07:00
a5c48871fa feat: add opentelemetry-instrumentation-threading library (#2253)
* feat: add opentelemetry-instrumentation-threading library

* fix: update python file with black formatter

* fix: modified title underline too short issue

* fix: modified library sorted via isort tool

* fix: modified CHANGELOG.md and remove unused parameter

* test: migrated unit test cases from the #1582 to this project

* chroe: updated the tox.ini test commands

* fix: fixed the lint issue

* feat: support ThreadPool and update document

* fix: fixed the lint issue

* refactor: remove redundant class and simplify capture OTel context usage

* fix: removed unused parameter

* test: added a new test case for thread pool

* fix: remove unused return response

* refactor: compared the array

* fix: remove f-string

* fix: fixed pylint issue

* fix: test library

* fix: updated CHANGELOG.md

---------

Co-authored-by: Aaron Abbott <aaronabbott@google.com>
2024-04-11 11:57:19 -05:00
805c72ceff rename type to asgi.event.type in ASGI instrumentation (#2300) 2024-04-04 17:10:30 +00:00
24eadcf63d Update version to 1.25.0.dev/0.46b0.dev (#2376) 2024-03-28 14:25:18 -07:00
37aba928d4 Add cloud.account.id attribute by AwsLambdaInstrumentor (#2367)
* Add cloud.account.id attribute by AwsLambdaInstrumentor

* Changelog

* Update test

* lint
2024-03-22 17:46:10 -06:00
d06de3f9f1 regression-fix: retain httpx.URL type on request.url (#2359)
* fix: retain httpx.URL type on request.url

This fixes a regression caused in #2020 where request.url stopped being of `httpx.URL` type, causing issues with request/response hooks.

* Update CHANGELOG.md

* tests: adding assertions to verify request.url on hooks is a httpx.URL

* fixup: adjust check to consider httpx < 0.20.0

* fixup: keep code dry

---------

Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2024-03-22 17:15:51 -06:00
ca082a7c52 elasticsearch: don't set body as db statement for bulk requests (#2355)
* elasticsearch: don't set body as db statement for bulk requests

bulk requests can be too big and diverse to make sense as db statement.
Other than that the sanitizer currently only handles dicts so it's
crashing.

Closes #2150

Co-authored-by: Jason Mobarak <git@jason.mobarak.name>
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>

* Update CHANGELOG

* Please the linter

---------

Co-authored-by: Jason Mobarak <git@jason.mobarak.name>
Co-authored-by: Quentin Pradet <quentin.pradet@gmail.com>
2024-03-22 16:56:29 -06:00
ada27842bd Remove [test] package from pika instrumentation (#2306)
Fixes #2209
2024-03-21 23:31:47 -06:00
86a552ecc8 Remove [test] package from boto3sqs instrumentation (#2252)
Fixes #2192
2024-03-22 04:39:20 +00:00
26479c8a34 Remove [test] package from pymysql instrumentation (#2272)
Fixes #2272
2024-03-22 04:21:36 +00:00
4360b5f6e8 Remove [test] package from confluent-kafka instrumentation (#2287)
Fixes #2196
2024-03-21 21:55:43 -06:00
c8889d7211 Remove [test] package from tortoiseorm instrumentation (#2281)
Fixes #2224
2024-03-21 21:39:57 -06:00
0e66ef6e20 Remove [test] package from system-metrics instrumentation (#2279)
Fixes #2222
2024-03-21 21:25:18 -06:00
9cf995c62e Remove [test] package from sqlite3 instrumentation (#2277)
Fixes #2220
2024-03-21 20:53:30 -06:00
a892b0b0f3 Remove [test] package from psycopg instrumentation (#2309)
Fixes #2308
2024-03-21 13:49:38 -06:00
847e8faadc Remove [test] package from sklearn instrumentation (#2303)
Fixes #2218
2024-03-21 13:06:16 -06:00
e7df01a26c Remove [test] package from remoulade instrumentation (#2275)
Fixes #2216
2024-03-21 12:15:13 -06:00
74f58219d0 Remove [test] package from redis instrumentation (#2274)
Fixes #2215
2024-03-21 11:58:12 -06:00
5207a78460 avoid losing repeated HTTP headers (#2266)
* avoid loosing repeated HTTP headers

* fix fof wsgi, test in falcon

* add changelog

* add more tests

* linting

* fix falcon and flask

* remove unused test

---------

Co-authored-by: Leighton Chen <lechen@microsoft.com>
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
2024-03-21 11:30:54 -06:00
b84d779104 Remove [test] package from pymongo instrumentation (#2269)
Fixes #2212
2024-03-20 18:51:55 -06:00
ca8daea8bf Remove [test] package from psycopg2 instrumentation (#2307)
Fixes #2210
2024-03-20 17:49:08 -06:00
fc864fe99a Remove [test] package from mysql instrumentation (#2294)
Fixes #2207
2024-03-20 15:31:58 -06:00
801dcedcb8 Remove [test] package from boto instrumentation (#2251)
Fixes #2191
2024-03-20 14:47:09 -06:00
ab97e07eef Remove [test] package from kafka-python instrumentation (#2292)
Fixes #2205
2024-03-20 14:30:38 -06:00
70d9b3d9ea Remove [test] package from jinja2 instrumentation (#2291)
Fixes #2204
2024-03-20 12:02:34 -06:00
51c78bf3a8 Remove [test] package from grpc instrumentation (#2290)
Fixes #2202
2024-03-20 11:40:37 -06:00
a8e57bfbb8 Remove [test] package from celery instrumentation (#2286)
Fixes #2195
2024-03-20 10:27:22 -06:00
ef7125000a Remove [test] package from botocore instrumentation (#2284)
Fixes #2193
2024-03-20 10:10:15 -06:00
5e1e866ec1 Remove [test] package from cassandra instrumentation (#2285)
Fixes #2194
2024-03-19 18:02:02 -06:00
11812b190a Remove [test] package from aws-lambda instrumentation (#2250)
Fixes #2190
2024-03-19 22:01:01 +00:00
78424fa985 Skip celery test case if running in PyPy (#2349)
Fixes #2348

Co-authored-by: Leighton Chen <lechen@microsoft.com>
2024-03-19 15:38:18 -06:00
1b68fdc8c8 Psycopg3 sync and async instrumentation (#2146) 2024-03-19 11:24:25 -07:00
c9832ba232 instrumentation/django: fix test_trace_parent (#2338) 2024-03-19 10:58:51 -07:00
dcffb584c4 Remove [test] package from asyncpg instrumentation (#2249)
Fixes #2189
2024-03-18 17:29:07 -06:00
9bb73fc4c5 Remove [test] package from logging instrumentation (#2293)
Fixes #2206
2024-03-18 16:46:13 -06:00
1782e96b77 Remove [test] package from dbapi instrumentation (#2288)
Fixes #2197
2024-03-18 19:42:10 +00:00
6c2e54da64 Remove [test] package from sqlalchemy instrumentation (#2315)
Fixes #2219

Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
2024-03-18 18:44:02 +00:00
617cae9375 Feature/convention http server duration (#2326)
* feat: add http.duration convention

* feat: add http.duration convention

* feat: replace for the last description version Duration of HTTP client requests

* feat: add new description to histogram
2024-03-18 17:29:10 +02:00