Skip to content

Commit

Permalink
fix(ci_visibility): use the default tracer when enabling CI Visibility (
Browse files Browse the repository at this point in the history
#9016)

This switches back to using the default tracer when using CI Visiblity,
and fixes an issue where non-test traces were getting lost due to:
* going through a non-existent local agent when using
`DD_CIVISIBILITY_AGENTLESS_ENABLED=true`
* being in a different tracer object which broke trace IDs

The historical change behind switching to a separate tracer was so that
we would be able to use CI Visibility in this repo, which was causing CI
Visibility traces to get mixed up with other traces. Since that would
remain a problem the behavior to use a separate tracer with a separate
context provider, via the use of
`_DD_CIVISIBILITY_USE_CI_CONTEXT_PROVIDER`, is maintained.

This also tweaks the `TraceCiVisibilityFilter` to no longer force the
`service` of spans to match that of the original under which the tracer
was started, which allows for test-level traces with non-test spans (eg:
with distributed tracing or `--ddtrace-patch-all` enabled) to properly
reflect the right services.

## Checklist

- [x] Change(s) are motivated and described in the PR description
- [x] Testing strategy is described if automated tests are not included
in the PR
- [x] Risks are described (performance impact, potential for breakage,
maintainability)
- [x] Change is maintainable (easy to change, telemetry, documentation)
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed or label `changelog/no-changelog` is set
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/))
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))
- [x] If this PR changes the public interface, I've notified
`@DataDog/apm-tees`.

## Reviewer Checklist

- [x] Title is accurate
- [x] All changes are related to the pull request's stated goal
- [x] Description motivates each change
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- [x] Testing strategy adequately addresses listed risks
- [x] Change is maintainable (easy to change, telemetry, documentation)
- [x] Release note makes sense to a user of the library
- [x] Author has acknowledged and discussed the performance implications
of this PR as reported in the benchmarks PR comment
- [x] Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
  • Loading branch information
romainkomorndatadog committed May 15, 2024
1 parent 5148d18 commit 6afcedb
Show file tree
Hide file tree
Showing 25 changed files with 489 additions and 104 deletions.
19 changes: 13 additions & 6 deletions .riot/requirements/1ceca0e.txt → .riot/requirements/10b8fc3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/1ceca0e.in
# pip-compile --no-annotate .riot/requirements/10b8fc3.in
#
anyio==4.3.0
asynctest==0.13.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
py==1.11.0
pytest==6.2.5
pytest-cov==4.1.0
pytest-mock==3.12.0
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
toml==0.10.2
19 changes: 13 additions & 6 deletions .riot/requirements/2a81450.txt → .riot/requirements/1163993.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/2a81450.in
# pip-compile --no-annotate .riot/requirements/1163993.in
#
anyio==4.3.0
asynctest==0.13.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
py==1.11.0
pytest==6.2.5
pytest-cov==4.1.0
pytest-mock==3.12.0
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
toml==0.10.2
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,31 @@
# This file is autogenerated by pip-compile with Python 3.7
# by the following command:
#
# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/b908e36.in
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/11bda89.in
#
anyio==3.7.1
attrs==23.2.0
certifi==2024.2.2
coverage[toml]==7.2.7
exceptiongroup==1.2.0
h11==0.14.0
httpcore==0.17.3
httpx==0.24.1
hypothesis==6.45.0
idna==3.7
importlib-metadata==6.7.0
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.5
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.2.0
pytest==7.4.4
pytest-cov==2.12.0
pytest-mock==2.0.0
pytest-randomly==3.12.0
sniffio==1.3.1
sortedcontainers==2.4.0
tomli==2.0.1
typing-extensions==4.7.1
Expand Down
21 changes: 14 additions & 7 deletions .riot/requirements/1e0c0d6.txt → .riot/requirements/1252d0f.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/1e0c0d6.in
# pip-compile --no-annotate .riot/requirements/1252d0f.in
#
anyio==4.3.0
asynctest==0.13.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
pytest==8.0.0
pytest-cov==4.1.0
pytest-mock==3.12.0
pytest==8.1.1
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
22 changes: 15 additions & 7 deletions .riot/requirements/cde42be.txt → .riot/requirements/144615f.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/cde42be.in
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/144615f.in
#
anyio==4.3.0
asynctest==0.13.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
exceptiongroup==1.2.0
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
pytest==8.0.0
pytest-cov==4.1.0
pytest-mock==3.12.0
pytest==8.1.1
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
tomli==2.0.1
typing-extensions==4.11.0
21 changes: 15 additions & 6 deletions .riot/requirements/1e49987.txt → .riot/requirements/14ca37f.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,33 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/1e49987.in
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/14ca37f.in
#
anyio==4.3.0
asynctest==0.13.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
exceptiongroup==1.2.0
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
py==1.11.0
pytest==6.2.5
pytest-cov==4.1.0
pytest-mock==3.12.0
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
toml==0.10.2
tomli==2.0.1
typing-extensions==4.11.0
19 changes: 13 additions & 6 deletions .riot/requirements/14d5757.txt → .riot/requirements/17cf97e.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/14d5757.in
# pip-compile --no-annotate .riot/requirements/17cf97e.in
#
anyio==4.3.0
asynctest==0.13.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
pytest==7.4.4
pytest-cov==4.1.0
pytest-mock==3.12.0
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
21 changes: 14 additions & 7 deletions .riot/requirements/17ecd2b.txt → .riot/requirements/18147c2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,28 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/17ecd2b.in
# pip-compile --no-annotate .riot/requirements/18147c2.in
#
anyio==4.3.0
asynctest==0.13.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
pytest==8.0.0
pytest-cov==4.1.0
pytest-mock==3.12.0
pytest==8.1.1
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
20 changes: 14 additions & 6 deletions .riot/requirements/764e316.txt → .riot/requirements/1b09cab.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,32 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/764e316.in
# pip-compile --config=pyproject.toml --no-annotate .riot/requirements/1b09cab.in
#
anyio==4.3.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
exceptiongroup==1.2.0
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
importlib-metadata==7.0.1
idna==3.7
importlib-metadata==7.1.0
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
pytest==7.4.4
pytest-cov==2.12.0
pytest-mock==2.0.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
tomli==2.0.1
zipp==3.17.0
typing-extensions==4.11.0
zipp==3.18.1
20 changes: 14 additions & 6 deletions .riot/requirements/1e67852.txt → .riot/requirements/1becf29.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/1e67852.in
# pip-compile --no-annotate --resolver=backtracking .riot/requirements/1becf29.in
#
anyio==4.3.0
asynctest==0.13.0
attrs==23.2.0
coverage[toml]==7.4.1
certifi==2024.2.2
coverage[toml]==7.4.4
exceptiongroup==1.2.0
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
mock==5.1.0
more-itertools==8.10.0
msgpack==1.0.7
msgpack==1.0.8
opentracing==2.4.0
packaging==23.2
packaging==24.0
pluggy==1.4.0
pytest==7.4.4
pytest-cov==4.1.0
pytest-mock==3.12.0
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sniffio==1.3.1
sortedcontainers==2.4.0
tomli==2.0.1
typing-extensions==4.11.0
Loading

0 comments on commit 6afcedb

Please sign in to comment.