Tags: discord/dd-trace-py
Tags
feat: add asyncpg integration (backport DataDog#3410) (DataDog#3428) (D… …ataDog#3434) * feat: add asyncpg integration (DataDog#3410) # Trace Integration This PR adds support for [`asyncpg`](https://magicstack.github.io/asyncpg/) starting with `v0.18.0`. [Connections](https://magicstack.github.io/asyncpg/current/api/index.html#connection), [cursors](https://magicstack.github.io/asyncpg/current/api/index.html#cursors) are traced. Note that this integration cannot use the `dbapi` patching that we commonly do due to asyncpg not following the api (dbapi in general is not compatible with async usage). Work for this was started in DataDog#394, thanks again to @thehesiod!! As a follow up, support can be added for [connection pools](https://magicstack.github.io/asyncpg/current/api/index.html#connection-pools). ## Links - Integration docs: https://magicstack.github.io/asyncpg/ - Corp docs PR: TODO - https://github.com/MagicStack/asyncpg - https://cs.github.com/MagicStack/asyncpg/ - https://pypi.org/project/asyncpg - https://github.com/encode/databases - [Connection source code](https://cs.github.com/MagicStack/asyncpg/blob/a2f093df6aceec7842709eaf92c5ff9df093efae/asyncpg/connection.py) - [Cursor source code](https://cs.github.com/MagicStack/asyncpg/blob/a2f093df6aceec7842709eaf92c5ff9df093efae/asyncpg/cursor.py ) ## Checklist - [x] Usage and configuration documentation added in `__init__.py`, `docs/index.rst` and `docs/integrations.rst`. - [ ] [Corp docs](https://github.com/Datadog/documentation) PR to add new integration to documentation. - [x] Span metadata - [x] Service (use [`int_service`](https://github.com/DataDog/dd-trace-py/blob/90d1d5981c72ea312c21ac04e5be47521d0f0f2e/ddtrace/contrib/trace_utils.py#L55) or [`ext_service`](https://github.com/DataDog/dd-trace-py/blob/90d1d5981c72ea312c21ac04e5be47521d0f0f2e/ddtrace/contrib/trace_utils.py#L87)). - [x] Span type should be one of [these](https://github.com/DataDog/dd-trace-py/blob/90d1d5981c72ea312c21ac04e5be47521d0f0f2e/ddtrace/ext/__init__.py#L7). - [x] Resource - [x] Measured tag - [x] ~Sample analytics~ - [x] Global configuration - [x] `ddtrace.config` entry is specified. - [x] Environment variables are provided for config options. - [x] Instance configuration - [x] Pin overriding. - [x] Service name override (if applicable). - [x] Async - [x] Span parenting behaves as expected. - [x] Context propagation across async contexts. - [x] Tests - [x] Use `pytest` fixtures found in `tests/conftest.py` or the test helpers on `TracerTestCase` if writing `unittest` style test cases. - [x] Tests are provided for all the above. - [x] Tests are added to CI (`.circleci/config.yml`). - [x] Functionality is maintained from original library by adding the library's test suite with the tracer enabled to our CI. - [x] Patch test cases are added (see `test_django_patch.py` for an example). - [x] All Python versions that the library supports are tested. - [x] All significant library versions (including the latest) are tested. This typically includes every minor release going back a few years. (cherry picked from commit a0515ec) * Update ddtrace/contrib/asyncpg/__init__.py Co-authored-by: Kyle Verhoog <[email protected]> Co-authored-by: Brett Langdon <[email protected]> (cherry picked from commit 4a18ed0) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
chore(tests): update brittle warning log assertion (DataDog#3430) (Da… …taDog#3431) (cherry picked from commit 3f6bca0) Co-authored-by: Brett Langdon <[email protected]>
fix(tracer): tracer log deprecation warning (DataDog#3415) * fix: fix tracer.log deprecation warning * chore: add release note for fix * Update fix-tracer-log-deprecation-f0664631263c6fda.yaml
fix(profiling): compute number of allocation events correctly (DataDo… …g#3393) (DataDog#3397) (cherry picked from commit ec60e55) Co-authored-by: Julien Danjou <[email protected]>
docs: fix deprecation guide in release notes (DataDog#3347) (DataDog#… …3353) (cherry picked from commit 48ed395) Co-authored-by: Tahir H. Butt <[email protected]>
feat: add 0.x upgrade guide for deprecations (DataDog#3338) (DataDog#… …3351) (cherry picked from commit 70fcc7b) Co-authored-by: Tahir H. Butt <[email protected]>
feat: add 0.x upgrade guide for deprecations (DataDog#3338) (DataDog#… …3351) (cherry picked from commit 70fcc7b) Co-authored-by: Tahir H. Butt <[email protected]>
fix: set_meta and set_metas deprecation warnings (DataDog#3325) (Data… …Dog#3327) (cherry picked from commit 326ef73) Co-authored-by: Munir Abdinur <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
fix(tracing/internal): fix encoding of propagated internal tags (Data… …Dog#3320) (DataDog#3322) Fixes: DataDog#3318 (cherry picked from commit b2819af) Co-authored-by: Brett Langdon <[email protected]>
fix(logging): fix service in log correlation (DataDog#3267) * fix(logging): fix service in log correlation * Update ddtrace/tracer.py * fix opentracer test Co-authored-by: Tahir H. Butt <[email protected]> Co-authored-by: Tahir H. Butt <[email protected]> Co-authored-by: Brett Langdon <[email protected]>
PreviousNext