Skip to content

Commit 20f2321

Browse files
fix(starlette): fixes starlette path/root_path handling [backport 2.7] (#8631)
Backport 67dbde1 from #8614 to 2.7. Starlette was updated upstream such that `root_path` now correctly contains the duplicated mounted path found in `path` for `starlette` v0.34+ as per ASGI standards. However, previously there was no duplication when mounting applications on `starlette`. This required us to set tags using both `root_path` and `path` within our ASGI tracing breaking with the newly fixed starlette versions. Logic is now implemented such that the ASGI middleware follows the correct specifications and only takes the `path` into consideration for tracing and older versions of `starlette` have their spans edited within the `starlette `integration ## 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`. - [x] If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. ## 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) Co-authored-by: Zarir Hamza <[email protected]>
1 parent 52a5770 commit 20f2321

35 files changed

+539
-553
lines changed

.riot/requirements/1fb983c.txt renamed to .riot/requirements/1185813.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,39 @@
22
# This file is autogenerated by pip-compile with Python 3.9
33
# by the following command:
44
#
5-
# pip-compile --no-annotate .riot/requirements/1fb983c.in
5+
# pip-compile --no-annotate .riot/requirements/1185813.in
66
#
77
aiofiles==23.2.1
8-
aiosqlite==0.19.0
9-
anyio==4.2.0
10-
attrs==23.1.0
11-
certifi==2023.11.17
8+
aiosqlite==0.20.0
9+
anyio==3.7.1
10+
attrs==23.2.0
11+
certifi==2024.2.2
1212
charset-normalizer==3.3.2
13-
coverage[toml]==7.3.4
13+
coverage[toml]==7.4.3
1414
databases==0.8.0
1515
exceptiongroup==1.2.0
16-
greenlet==3.0.3
1716
h11==0.14.0
18-
httpcore==1.0.2
19-
httpx==0.26.0
17+
httpcore==1.0.4
18+
httpx==0.27.0
2019
hypothesis==6.45.0
2120
idna==3.6
22-
importlib-metadata==7.0.0
21+
importlib-metadata==7.0.1
2322
iniconfig==2.0.0
2423
mock==5.1.0
2524
opentracing==2.4.0
2625
packaging==23.2
27-
pluggy==1.3.0
28-
pytest==7.4.3
26+
pluggy==1.4.0
27+
pytest==8.0.2
2928
pytest-asyncio==0.21.1
3029
pytest-cov==4.1.0
3130
pytest-mock==3.12.0
3231
pytest-randomly==3.15.0
3332
requests==2.31.0
34-
sniffio==1.3.0
33+
sniffio==1.3.1
3534
sortedcontainers==2.4.0
36-
sqlalchemy==1.4.50
37-
starlette==0.34.0
35+
sqlalchemy==1.4.52
36+
starlette==0.14.2
3837
tomli==2.0.1
39-
typing-extensions==4.9.0
40-
urllib3==2.1.0
38+
typing-extensions==4.10.0
39+
urllib3==2.2.1
4140
zipp==3.17.0

.riot/requirements/b224664.txt renamed to .riot/requirements/12bc9cf.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,39 @@
22
# This file is autogenerated by pip-compile with Python 3.8
33
# by the following command:
44
#
5-
# pip-compile --no-annotate .riot/requirements/b224664.in
5+
# pip-compile --no-annotate .riot/requirements/12bc9cf.in
66
#
77
aiofiles==23.2.1
8-
aiosqlite==0.19.0
9-
anyio==4.2.0
10-
attrs==23.1.0
11-
certifi==2023.11.17
8+
aiosqlite==0.20.0
9+
anyio==3.7.1
10+
attrs==23.2.0
11+
certifi==2024.2.2
1212
charset-normalizer==3.3.2
13-
coverage[toml]==7.3.4
13+
coverage[toml]==7.4.3
1414
databases==0.8.0
1515
exceptiongroup==1.2.0
16-
greenlet==3.0.3
1716
h11==0.14.0
18-
httpcore==1.0.2
19-
httpx==0.26.0
17+
httpcore==1.0.4
18+
httpx==0.27.0
2019
hypothesis==6.45.0
2120
idna==3.6
22-
importlib-metadata==7.0.0
21+
importlib-metadata==7.0.1
2322
iniconfig==2.0.0
2423
mock==5.1.0
2524
opentracing==2.4.0
2625
packaging==23.2
27-
pluggy==1.3.0
28-
pytest==7.4.3
26+
pluggy==1.4.0
27+
pytest==8.0.2
2928
pytest-asyncio==0.21.1
3029
pytest-cov==4.1.0
3130
pytest-mock==3.12.0
3231
pytest-randomly==3.15.0
3332
requests==2.31.0
34-
sniffio==1.3.0
33+
sniffio==1.3.1
3534
sortedcontainers==2.4.0
36-
sqlalchemy==1.4.50
37-
starlette==0.34.0
35+
sqlalchemy==1.4.52
36+
starlette==0.37.2
3837
tomli==2.0.1
39-
typing-extensions==4.9.0
40-
urllib3==2.1.0
38+
typing-extensions==4.10.0
39+
urllib3==2.2.1
4140
zipp==3.17.0

.riot/requirements/1715f3b.txt renamed to .riot/requirements/135e6d3.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
5-
# pip-compile --no-annotate .riot/requirements/1715f3b.in
5+
# pip-compile --no-annotate .riot/requirements/135e6d3.in
66
#
77
aiofiles==23.2.1
8-
aiosqlite==0.19.0
9-
anyio==4.2.0
10-
attrs==23.1.0
11-
certifi==2023.11.17
8+
aiosqlite==0.20.0
9+
anyio==3.7.1
10+
attrs==23.2.0
11+
certifi==2024.2.2
1212
charset-normalizer==3.3.2
13-
coverage[toml]==7.3.4
13+
coverage[toml]==7.4.3
1414
databases==0.8.0
15-
greenlet==3.0.3
1615
h11==0.14.0
17-
httpcore==1.0.2
18-
httpx==0.26.0
16+
httpcore==1.0.4
17+
httpx==0.27.0
1918
hypothesis==6.45.0
2019
idna==3.6
2120
iniconfig==2.0.0
2221
mock==5.1.0
2322
opentracing==2.4.0
2423
packaging==23.2
25-
pluggy==1.3.0
26-
pytest==7.4.3
24+
pluggy==1.4.0
25+
pytest==8.0.2
2726
pytest-asyncio==0.21.1
2827
pytest-cov==4.1.0
2928
pytest-mock==3.12.0
3029
pytest-randomly==3.15.0
3130
requests==2.31.0
32-
sniffio==1.3.0
31+
sniffio==1.3.1
3332
sortedcontainers==2.4.0
34-
sqlalchemy==1.4.50
35-
starlette==0.34.0
36-
urllib3==2.1.0
33+
sqlalchemy==1.4.52
34+
starlette==0.37.2
35+
typing-extensions==4.10.0
36+
urllib3==2.2.1

.riot/requirements/1df36ab.txt renamed to .riot/requirements/1406f3b.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,39 @@
22
# This file is autogenerated by pip-compile with Python 3.9
33
# by the following command:
44
#
5-
# pip-compile --no-annotate .riot/requirements/1df36ab.in
5+
# pip-compile --no-annotate .riot/requirements/1406f3b.in
66
#
77
aiofiles==23.2.1
8-
aiosqlite==0.19.0
9-
anyio==4.2.0
10-
attrs==23.1.0
11-
certifi==2023.11.17
8+
aiosqlite==0.20.0
9+
anyio==3.7.1
10+
attrs==23.2.0
11+
certifi==2024.2.2
1212
charset-normalizer==3.3.2
13-
coverage[toml]==7.3.4
13+
coverage[toml]==7.4.3
1414
databases==0.8.0
1515
exceptiongroup==1.2.0
16-
greenlet==3.0.3
1716
h11==0.14.0
18-
httpcore==1.0.2
19-
httpx==0.26.0
17+
httpcore==1.0.4
18+
httpx==0.27.0
2019
hypothesis==6.45.0
2120
idna==3.6
22-
importlib-metadata==7.0.0
21+
importlib-metadata==7.0.1
2322
iniconfig==2.0.0
2423
mock==5.1.0
2524
opentracing==2.4.0
2625
packaging==23.2
27-
pluggy==1.3.0
28-
pytest==7.4.3
26+
pluggy==1.4.0
27+
pytest==8.0.2
2928
pytest-asyncio==0.21.1
3029
pytest-cov==4.1.0
3130
pytest-mock==3.12.0
3231
pytest-randomly==3.15.0
3332
requests==2.31.0
34-
sniffio==1.3.0
33+
sniffio==1.3.1
3534
sortedcontainers==2.4.0
36-
sqlalchemy==1.4.50
37-
starlette==0.34.0
35+
sqlalchemy==1.4.52
36+
starlette==0.33.0
3837
tomli==2.0.1
39-
typing-extensions==4.9.0
40-
urllib3==2.1.0
38+
typing-extensions==4.10.0
39+
urllib3==2.2.1
4140
zipp==3.17.0

.riot/requirements/6732786.txt renamed to .riot/requirements/16c5a53.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
# This file is autogenerated by pip-compile with Python 3.11
33
# by the following command:
44
#
5-
# pip-compile --no-annotate .riot/requirements/6732786.in
5+
# pip-compile --no-annotate .riot/requirements/16c5a53.in
66
#
77
aiofiles==23.2.1
8-
aiosqlite==0.19.0
9-
anyio==4.2.0
10-
attrs==23.1.0
11-
certifi==2023.11.17
8+
aiosqlite==0.20.0
9+
anyio==3.7.1
10+
attrs==23.2.0
11+
certifi==2024.2.2
1212
charset-normalizer==3.3.2
13-
coverage[toml]==7.3.4
13+
coverage[toml]==7.4.3
1414
databases==0.8.0
15-
greenlet==3.0.3
1615
h11==0.14.0
17-
httpcore==1.0.2
18-
httpx==0.26.0
16+
httpcore==1.0.4
17+
httpx==0.27.0
1918
hypothesis==6.45.0
2019
idna==3.6
2120
iniconfig==2.0.0
2221
mock==5.1.0
2322
opentracing==2.4.0
2423
packaging==23.2
25-
pluggy==1.3.0
26-
pytest==7.4.3
24+
pluggy==1.4.0
25+
pytest==8.0.2
2726
pytest-asyncio==0.21.1
2827
pytest-cov==4.1.0
2928
pytest-mock==3.12.0
3029
pytest-randomly==3.15.0
3130
requests==2.31.0
32-
sniffio==1.3.0
31+
sniffio==1.3.1
3332
sortedcontainers==2.4.0
34-
sqlalchemy==1.4.50
35-
starlette==0.34.0
36-
urllib3==2.1.0
33+
sqlalchemy==1.4.52
34+
starlette==0.21.0
35+
typing-extensions==4.10.0
36+
urllib3==2.2.1

.riot/requirements/1db9729.txt renamed to .riot/requirements/179c00c.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
# This file is autogenerated by pip-compile with Python 3.7
33
# by the following command:
44
#
5-
# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/1db9729.in
5+
# pip-compile --config=pyproject.toml --no-annotate --resolver=backtracking .riot/requirements/179c00c.in
66
#
77
aiofiles==23.2.1
88
aiosqlite==0.19.0
99
anyio==3.7.1
10-
attrs==23.1.0
11-
certifi==2023.11.17
10+
attrs==23.2.0
11+
certifi==2024.2.2
1212
charset-normalizer==3.3.2
1313
coverage[toml]==7.2.7
1414
databases==0.8.0
1515
exceptiongroup==1.2.0
16-
greenlet==3.0.3
1716
h11==0.14.0
1817
httpcore==0.17.3
1918
httpx==0.24.1
@@ -25,16 +24,16 @@ mock==5.1.0
2524
opentracing==2.4.0
2625
packaging==23.2
2726
pluggy==1.2.0
28-
pytest==7.4.3
27+
pytest==7.4.4
2928
pytest-asyncio==0.21.1
3029
pytest-cov==4.1.0
3130
pytest-mock==3.11.1
3231
pytest-randomly==3.12.0
3332
requests==2.31.0
34-
sniffio==1.3.0
33+
sniffio==1.3.1
3534
sortedcontainers==2.4.0
36-
sqlalchemy==1.4.50
37-
starlette==0.29.0
35+
sqlalchemy==1.4.52
36+
starlette==0.20.4
3837
tomli==2.0.1
3938
typing-extensions==4.7.1
4039
urllib3==2.0.7

.riot/requirements/99b9dc8.txt renamed to .riot/requirements/17ed83b.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,39 @@
22
# This file is autogenerated by pip-compile with Python 3.9
33
# by the following command:
44
#
5-
# pip-compile --no-annotate .riot/requirements/99b9dc8.in
5+
# pip-compile --no-annotate .riot/requirements/17ed83b.in
66
#
77
aiofiles==23.2.1
8-
aiosqlite==0.19.0
9-
anyio==4.2.0
10-
attrs==23.1.0
11-
certifi==2023.11.17
8+
aiosqlite==0.20.0
9+
anyio==3.7.1
10+
attrs==23.2.0
11+
certifi==2024.2.2
1212
charset-normalizer==3.3.2
13-
coverage[toml]==7.3.4
13+
coverage[toml]==7.4.3
1414
databases==0.8.0
1515
exceptiongroup==1.2.0
16-
greenlet==3.0.3
1716
h11==0.14.0
18-
httpcore==1.0.2
19-
httpx==0.26.0
17+
httpcore==1.0.4
18+
httpx==0.27.0
2019
hypothesis==6.45.0
2120
idna==3.6
22-
importlib-metadata==7.0.0
21+
importlib-metadata==7.0.1
2322
iniconfig==2.0.0
2423
mock==5.1.0
2524
opentracing==2.4.0
2625
packaging==23.2
27-
pluggy==1.3.0
28-
pytest==7.4.3
26+
pluggy==1.4.0
27+
pytest==8.0.2
2928
pytest-asyncio==0.21.1
3029
pytest-cov==4.1.0
3130
pytest-mock==3.12.0
3231
pytest-randomly==3.15.0
3332
requests==2.31.0
34-
sniffio==1.3.0
33+
sniffio==1.3.1
3534
sortedcontainers==2.4.0
36-
sqlalchemy==1.4.50
37-
starlette==0.34.0
35+
sqlalchemy==1.4.52
36+
starlette==0.37.2
3837
tomli==2.0.1
39-
typing-extensions==4.9.0
40-
urllib3==2.1.0
38+
typing-extensions==4.10.0
39+
urllib3==2.2.1
4140
zipp==3.17.0

0 commit comments

Comments
 (0)