1724 Commits

Author SHA1 Message Date
bb41b4600a Fix fastapi version (#1664) 2023-02-13 12:17:38 +05:30
3bcc9fb517 add a test for pymemcache using NoOpTracerProvider (#1650)
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-11 15:11:22 +05:30
df32e8ca7f add elasticsearch db.statement sanitization (#1598) 2023-02-10 06:20:42 +05:30
dbf
7af87e1bec [TortoiseORM instrumentation] Fix AttributeError: type object 'Config' has no attribute 'title' (#1575)
* Use pydantic model name as default `title` value

* Update `CHANGELOG.md`

* Format with black

* Lint with `black`
2023-02-06 12:20:20 +00:00
66ceef5fe1 Support aio_pika 8.x (#1481)
* Support aio_pika 8

- Fix tests for new shape of the AbstractConnection class
- Run tests against aio_pika 7 and 8

* Update CHANGELOG.md

---------

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-05 11:54:21 +05:30
2519223a5c Audit and test opentelemetry-instrumentation-aiopg NoOpTracerProvider (#1606)
* Audit and test opentelemetry-instrumentation-aiopg NoOpTracerProvider

* Change line length

---------

Co-authored-by: Shalev Roda <65566801+shalevr@users.noreply.github.com>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-04 20:55:41 +00:00
a217682a39 Add a test for aws lambda using NoOpTracerProvider (#1602)
* add a test for aws lambda using NoOpTracerProvider

* fix import

* add assert for spans

---------

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-04 19:41:30 +00:00
2b6f913790 Add Redis instrumentation query sanitization (#1572)
* Add Redis instrumentation query sanitization

Add a query sanitizer to the Redis instrumentation. This can be disabled
with the `sanitize_query = False` config option.

Given the query `SET key value`, the sanitized query becomes `SET ? ?`.
Both the keys and values are sanitized, as both can contain PII data.

The Redis queries are sanitized by default. This changes the default
behavior of this instrumentation. Previously it reported unsanitized
Redis queries.

This was previously discussed in the previous implementation of this PR
in PR #1571

Closes #1548

* Update Redis sanitize_query option documentation

Changes suggested in
https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1572#discussion_r1066069584

* Remove uninstrument & instrument from test setup

The Redis test that performs the tests with the default options, doesn't
need to uninstrument and then instrument the instrumentor. This commit
removes the unnecessary setup code. The setup code is already present at
the top of the file.

* Fix code style formatting

* Update Redis functional tests

- Update the sanitizer to also account for a max `db.statement`
  attribute value length. No longer than 1000 characters.
- Update the functional tests to assume the queries are sanitized by
  default.
- Add new tests that test the behavior with sanitization turned off.
  Only for the tests in the first test class. I don't think it's needed
  to duplicate this test for the clustered and async setup combinations.

* Test Redis unsanitized queries by default

Change the Redis functional tests so that they test the unsanitized
query by default, and test the sanitized query results in the separate
test functions.

This is a partial revert of the previous commit
8d56c2f72e12c7d7dc4ef25a9fe6a69ea685a6d8

* Fix formatting issue in Redis utils

* Disable Redis query sanitization by default

Update the Redis instrumentation library to not change the default
behavior for the Redis instrumentation. This can be enabled at a later
time when the spec discussion about this topic has concluded.

https://github.com/open-telemetry/opentelemetry-specification/issues/3104

* Fix pylint issue

Remove else statement.

* Update changelog about Redis query sanitization default

[ci skip]

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>

* Fix potential error on Redis args being 0

Check the length of the args array and return an empty string if there
are no args.

That way it won't cause an IndexError if the args array is empty and it
tries to fetch the first element, which should be the Redis command.

---------

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-04 14:22:23 +00:00
3770e574eb Add ability to exclude some routes explicitly with Django Instrumentation (#1618) 2023-02-03 15:14:28 -08:00
673e4aadb4 Record exception in Celery instrumentation (#1573)
* Add tests for errors in Celery tasks

I noticed there were no tests for the error scenario in the Celery
package. This commit adds a basic test, based on the previous test and
how I see other packages test the error status on the span.

Part of #987

* Record exception in Celery instrumentation

In addition to setting the status on the span, also record the exception
on the span. This adds an event to the span with more details about the
error, following the format other instrumentations also use.

* Update CHANGELOG with Celery record exception

* Fix lint code formatting issues

* Move Celery error tests to the functional tests

The celery tests failed on Python 3.11. This is most likely due to this
issue in billiard, a celery dependency, about it not working on Python
3.11 because of the error reported in the CI:
https://github.com/celery/billiard/issues/377

It's been fixed in billiard 4.1.0, but celery is locked on billiard
version lower than 4, so it cannot use this version with the fix.

This issue does not arise on the Docker tests, because they use Python
3.9.16.

I've moved the error test span event assertions to the error test that
is available in the functional tests, and removed the unit test. That
way, the build will run successfully.

* Remove duplicate entry in changelog

This was added in a recent merge commit on this PR branch.

* Remove unused test code

With the move of the tests for tasks with errors to the functional
tests, remove the unit test's error task and unused imports.

---------

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-03 04:30:57 +00:00
520e58d62a Update README.md (#1617) 2023-02-03 03:46:25 +00:00
78874df5c2 Fix install of Python 3.10 on GitHub Actions (#1609)
* Fix install of Python 3.10 on GitHub Actions

In PR #1604 the Python version was upgraded to Python 3.10 to fix a
local issue on M1 MacBooks.

The GitHub Action workflows now exit with the following message for the
docker-tests, spellcheck and lint checks, skipping these checks.

```
lint create: /home/runner/work/opentelemetry-python-contrib/opentelemetry-python-contrib/.tox/lint
SKIPPED: InterpreterNotFound: python3.10
___________________________________ summary ____________________________________
SKIPPED:  lint: InterpreterNotFound: python3.10
  congratulations :)
```

Upgrade the Python version in the GitHub Actions workflow to fix this.

* Fix YAML interpretation of Python 3.10

* Upgrade Docker tests dependencies

Upgrade the asyncpg and psycopg2 packages, they don't work on Python
3.10.

This also fixes running these tests no M1 MacBooks.

* Fix linter issues merged into main

They went unnoticed while the CI didn't fail on the lint task not
working.

---------

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
2023-02-03 08:37:24 +05:30
d8788b68dd Flush meter provider at end of lambda function handler (#1613)
* Flush meter provider at end of lambda function handler

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update `force_flush()` check based on PR feedback

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

---------

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
2023-02-01 19:13:53 +05:30
6ed2c56eca Value of trace_configs might be None (#1592) 2023-01-31 10:51:15 +00:00
bbe7578d17 Fix sqlalchemy uninstrument (#1581) 2023-01-29 09:43:06 +05:30
a300d65ccf Update some environments to 3.10 (#1604)
Fixes #1603
2023-01-28 03:57:38 +05:30
1c27b775f2 [docs] Fixing examples formating (#1585) 2023-01-26 13:42:22 +00:00
810d9825cd mongo db - fix db statement capturing (#1512) 2023-01-24 03:15:28 +00:00
e1a1bada1f Remove update-sha workflow (#1594) 2023-01-24 01:24:01 +05:30
cca90db86f add aio_pika to tox (#1590) 2023-01-21 10:45:12 +05:30
a8f86f6fc7 Modified tox.ini to fix the comment line (#1588) 2023-01-20 18:50:08 +00:00
d75e19768a bugfix(opentelemetry-instrumentation-grpc): Add code() and details() to ServicerContext (#1578) 2023-01-20 17:30:25 +00:00
dd7afe0cc6 Automated release workflow (#1580) 2023-01-19 01:47:34 +05:30
e23dd5c25a add a test for urllib3 using NoOpTracerProvider (#1574) 2023-01-18 15:41:46 +05:30
c92ba14316 Add metric instrumentation for urllib (#1553) 2023-01-15 10:03:05 +05:30
092d8c86bb Fix ASGIGetter keys to fetch from actual carrier headers (#1435) 2023-01-12 21:24:04 +00:00
43d0c6cae3 fix the instantiation of NoOpTracerProvider (#1577) 2023-01-12 17:16:03 +00:00
bf9a8e87a0 Implement aws.ecs.* resource attributes (#1212) 2023-01-11 21:35:02 +00:00
70187ff3a3 Pymongo capture collection name (#1555) 2023-01-11 12:47:54 +00:00
d1dec9220b add a test for urllib using NoOpTracerProvider (#1560) 2023-01-10 16:23:48 +00:00
494bf0999c add a test for redis using NoOpTracerProvider (#1559) 2023-01-09 09:15:00 +00:00
6d1550bb0b add python-kafka to docs (#1552) 2023-01-07 05:19:39 +00:00
3dc2f8ee30 add elasticsearch to docs (#1542) 2023-01-06 20:35:44 +00:00
1f0dda9865 Add uninstrument test for django (#1557) 2023-01-06 17:34:15 +00:00
a97326d871 Add uninstrument test for starlette (#1558) 2023-01-06 22:34:49 +05:30
c1206d9c08 Fix typo in Django docs (#1562) 2023-01-06 09:54:27 +05:30
1f96608388 Add aio_pika readthedocs documentation (#1504) 2023-01-04 05:26:37 +05:30
de4cde7e33 add tortoiseorm docs (#1541) 2023-01-02 23:42:29 +05:30
abaa26381e auto generate system metrics docs (#1530) 2023-01-01 22:43:13 +00:00
6d1c740eff Add uninstrument test for boto3sqs (#1550) 2023-01-01 21:06:56 +00:00
346160467f add a test using NoOpTracerProvider - sqlalchemy (#1508) 2023-01-01 18:33:34 +00:00
e79b313bd7 Add/aws lamda docs (#1534) 2023-01-01 23:32:20 +05:30
f38eeb73df Update the usage of set-output command in GH actions (#1464) 2022-12-29 17:48:45 +00:00
41438ba9d2 add docs/instrumentation component owner (#1535) 2022-12-27 14:29:32 +00:00
0518050a04 Add entry for urllib3 instrumentation component owner (#1536) 2022-12-27 19:20:14 +05:30
15ee4a0ac9 add a test for pymongo with NoOpTracer (#1537) 2022-12-27 07:38:30 +00:00
ddbc40f907 add pika to docs (#1540) 2022-12-27 12:39:49 +05:30
426d641590 Add remoulade readthedocs documentation (#1515) 2022-12-22 19:29:29 +00:00
9fbb1febfe Add uninstrument test for remoulade instrumentation (#1528) 2022-12-22 18:31:11 +00:00
e7ff9a9be7 Add entry to component_owners.yml (#1511) 2022-12-22 17:31:05 +00:00