Skip to content

Tags: discord/dd-trace-py

Tags

v0.60.0rc2

Toggle v0.60.0rc2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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>

v1.0.0rc2

Toggle v1.0.0rc2's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
chore(tests): update brittle warning log assertion (DataDog#3430) (Da…

…taDog#3431)

(cherry picked from commit 3f6bca0)

Co-authored-by: Brett Langdon <[email protected]>

v0.60.0rc1

Toggle v0.60.0rc1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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

v0.59.1

Toggle v0.59.1's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
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]>

v1.0.0rc1

Toggle v1.0.0rc1's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
docs: fix deprecation guide in release notes (DataDog#3347) (DataDog#…

…3353)

(cherry picked from commit 48ed395)

Co-authored-by: Tahir H. Butt <[email protected]>

v0.59.0

Toggle v0.59.0's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
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]>

v0.59.0rc3

Toggle v0.59.0rc3's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
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]>

v0.59.0rc2

Toggle v0.59.0rc2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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>

v0.58.5

Toggle v0.58.5's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
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]>

v0.59.0rc1

Toggle v0.59.0rc1's commit message

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
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]>