Skip to content

Commit 95b3d16

Browse files
chore(tracing): add integration guardrails (#13483)
# Description This PR adds a feature to ensure safe patching of instrumentation libraries by checking the installed version of the library is compatible with an explicitly defined support range for the related integration. To enable the feature, set `DD_TRACE_SAFE_INSTRUMENTATION_ENABLED=true`. It is disabled by default. The PR adds integration guardrails by introducing a new function that returns supported version specs in each integration patch file. This is used by `ddtrace._monkey.py` during the integration module hook, looking at the installed module version and comparing against our guardrails spec for the integration. Guardrails version spec will be based off of minimum used dependency versions used by customers via Metabase dependency data. ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - 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: Brett Langdon <[email protected]>
1 parent ac13894 commit 95b3d16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1671
-254
lines changed

.riot/requirements/113966a.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.9
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate --resolver=backtracking .riot/requirements/113966a.in
6+
#
7+
aiobotocore==1.0.7
8+
aiohappyeyeballs==2.6.1
9+
aiohttp==3.12.2
10+
aioitertools==0.12.0
11+
aiosignal==1.3.2
12+
async-generator==1.10
13+
async-timeout==5.0.1
14+
attrs==25.3.0
15+
botocore==1.15.32
16+
coverage[toml]==7.8.2
17+
docutils==0.15.2
18+
exceptiongroup==1.3.0
19+
frozenlist==1.6.0
20+
hypothesis==6.45.0
21+
idna==3.10
22+
importlib-metadata==8.7.0
23+
iniconfig==2.1.0
24+
jmespath==0.10.0
25+
mock==5.2.0
26+
multidict==6.4.4
27+
opentracing==2.4.0
28+
packaging==25.0
29+
pluggy==1.6.0
30+
propcache==0.3.1
31+
pytest==8.3.5
32+
pytest-asyncio==0.21.1
33+
pytest-cov==6.1.1
34+
pytest-mock==3.14.1
35+
pytest-randomly==3.16.0
36+
python-dateutil==2.9.0.post0
37+
six==1.17.0
38+
sortedcontainers==2.4.0
39+
tomli==2.2.1
40+
typing-extensions==4.13.2
41+
urllib3==1.25.11
42+
wrapt==1.17.2
43+
yarl==1.20.0
44+
zipp==3.22.0

.riot/requirements/11c2039.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# pip-compile --allow-unsafe --no-annotate .riot/requirements/11c2039.in
66
#
77
attrs==25.3.0
8-
coverage[toml]==7.8.0
8+
coverage[toml]==7.8.2
99
gevent==25.5.1
1010
greenlet==3.2.2
1111
gunicorn[gevent]==23.0.0
@@ -15,18 +15,19 @@ lz4==4.4.4
1515
mock==5.2.0
1616
opentracing==2.4.0
1717
packaging==25.0
18-
pluggy==1.5.0
18+
pluggy==1.6.0
1919
py-cpuinfo==8.0.0
20-
pytest==8.3.5
20+
pygments==2.19.1
21+
pytest==8.4.0
2122
pytest-asyncio==0.21.1
2223
pytest-benchmark==5.1.0
2324
pytest-cov==6.1.1
24-
pytest-mock==3.14.0
25+
pytest-mock==3.14.1
2526
pytest-randomly==3.16.0
2627
sortedcontainers==2.4.0
27-
uwsgi==2.0.29
28+
uwsgi==2.0.30
2829
zope-event==5.0
2930
zope-interface==7.2
3031

3132
# The following packages are considered to be unsafe in a requirements file:
32-
setuptools==80.4.0
33+
setuptools==80.9.0

.riot/requirements/150beac.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/150beac.in
6+
#
7+
aiobotocore==1.0.7
8+
aiohappyeyeballs==2.6.1
9+
aiohttp==3.12.2
10+
aioitertools==0.12.0
11+
aiosignal==1.3.2
12+
async-generator==1.10
13+
attrs==25.3.0
14+
botocore==1.15.32
15+
coverage[toml]==7.8.2
16+
docutils==0.15.2
17+
frozenlist==1.6.0
18+
hypothesis==6.45.0
19+
idna==3.10
20+
iniconfig==2.1.0
21+
jmespath==0.10.0
22+
mock==5.2.0
23+
multidict==6.4.4
24+
opentracing==2.4.0
25+
packaging==25.0
26+
pluggy==1.6.0
27+
propcache==0.3.1
28+
pytest==8.3.5
29+
pytest-asyncio==0.21.1
30+
pytest-cov==6.1.1
31+
pytest-mock==3.14.1
32+
pytest-randomly==3.16.0
33+
python-dateutil==2.9.0.post0
34+
six==1.17.0
35+
sortedcontainers==2.4.0
36+
urllib3==1.25.11
37+
wrapt==1.17.2
38+
yarl==1.20.0

.riot/requirements/158ac30.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
5-
# pip-compile --no-annotate .riot/requirements/158ac30.in
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/158ac30.in
66
#
77
aiohappyeyeballs==2.6.1
8-
aiohttp==3.12.2
8+
aiohttp==3.12.7
99
aiosignal==1.3.2
1010
annotated-types==0.7.0
1111
anyio==4.9.0
@@ -23,11 +23,11 @@ cachetools==5.5.2
2323
certifi==2025.4.26
2424
cffi==1.17.1
2525
charset-normalizer==3.4.2
26-
chromadb==1.0.10
26+
chromadb==1.0.12
2727
click==8.2.1
2828
coloredlogs==15.0.1
2929
coverage[toml]==7.8.2
30-
crewai==0.121.0
30+
crewai==0.121.1
3131
cryptography==45.0.3
3232
decorator==5.2.1
3333
deprecated==1.2.18
@@ -44,27 +44,27 @@ frozenlist==1.6.0
4444
fsspec==2025.5.1
4545
google-auth==2.40.2
4646
googleapis-common-protos==1.70.0
47-
grpcio==1.71.0
47+
grpcio==1.72.1
4848
h11==0.16.0
4949
hf-xet==1.1.2
5050
httpcore==1.0.9
5151
httptools==0.6.4
5252
httpx==0.28.1
53-
huggingface-hub==0.32.2
53+
huggingface-hub==0.32.4
5454
humanfriendly==10.0
5555
hypothesis==6.45.0
5656
idna==3.10
5757
importlib-metadata==8.6.1
5858
importlib-resources==6.5.2
5959
iniconfig==2.1.0
6060
instructor==1.8.3
61-
ipython==8.36.0
61+
ipython==8.37.0
6262
jedi==0.19.2
6363
jinja2==3.1.6
6464
jiter==0.8.2
6565
json-repair==0.46.0
6666
json5==0.12.0
67-
jsonpickle==4.1.0
67+
jsonpickle==4.1.1
6868
jsonref==1.1.0
6969
jsonschema==4.24.0
7070
jsonschema-specifications==2025.4.1
@@ -108,7 +108,7 @@ pluggy==1.6.0
108108
posthog==4.2.0
109109
prompt-toolkit==3.0.51
110110
propcache==0.3.1
111-
protobuf==5.29.4
111+
protobuf==5.29.5
112112
ptyprocess==0.7.0
113113
pure-eval==0.2.3
114114
pyasn1==0.6.1
@@ -121,7 +121,7 @@ pyjwt==2.10.1
121121
pypdfium2==4.30.1
122122
pypika==0.48.9
123123
pyproject-hooks==1.2.0
124-
pytest==8.3.5
124+
pytest==8.4.0
125125
pytest-asyncio==1.0.0
126126
pytest-cov==6.1.1
127127
pytest-mock==3.14.1
@@ -151,11 +151,11 @@ tomli-w==1.2.0
151151
tqdm==4.67.1
152152
traitlets==5.14.3
153153
typer==0.16.0
154-
typing-extensions==4.13.2
154+
typing-extensions==4.14.0
155155
typing-inspection==0.4.1
156156
urllib3==2.4.0
157-
uv==0.7.8
158-
uvicorn[standard]==0.34.2
157+
uv==0.7.9
158+
uvicorn[standard]==0.34.3
159159
uvloop==0.21.0
160160
vcrpy==7.0.0
161161
watchfiles==1.0.5

.riot/requirements/16628a6.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile --no-annotate .riot/requirements/16628a6.in
5+
# pip-compile --allow-unsafe --no-annotate .riot/requirements/16628a6.in
66
#
77
aiohappyeyeballs==2.6.1
8-
aiohttp==3.12.2
8+
aiohttp==3.12.7
99
aiosignal==1.3.2
1010
annotated-types==0.7.0
1111
anyio==4.9.0
@@ -22,11 +22,11 @@ cachetools==5.5.2
2222
certifi==2025.4.26
2323
cffi==1.17.1
2424
charset-normalizer==3.4.2
25-
chromadb==1.0.10
25+
chromadb==1.0.12
2626
click==8.2.1
2727
coloredlogs==15.0.1
2828
coverage[toml]==7.8.2
29-
crewai==0.121.0
29+
crewai==0.121.1
3030
cryptography==45.0.3
3131
decorator==5.2.1
3232
deprecated==1.2.18
@@ -42,28 +42,28 @@ frozenlist==1.6.0
4242
fsspec==2025.5.1
4343
google-auth==2.40.2
4444
googleapis-common-protos==1.70.0
45-
grpcio==1.71.0
45+
grpcio==1.72.1
4646
h11==0.16.0
4747
hf-xet==1.1.2
4848
httpcore==1.0.9
4949
httptools==0.6.4
5050
httpx==0.28.1
51-
huggingface-hub==0.32.2
51+
huggingface-hub==0.32.4
5252
humanfriendly==10.0
5353
hypothesis==6.45.0
5454
idna==3.10
5555
importlib-metadata==8.6.1
5656
importlib-resources==6.5.2
5757
iniconfig==2.1.0
5858
instructor==1.8.3
59-
ipython==9.2.0
59+
ipython==9.3.0
6060
ipython-pygments-lexers==1.1.1
6161
jedi==0.19.2
6262
jinja2==3.1.6
6363
jiter==0.8.2
6464
json-repair==0.46.0
6565
json5==0.12.0
66-
jsonpickle==4.1.0
66+
jsonpickle==4.1.1
6767
jsonref==1.1.0
6868
jsonschema==4.24.0
6969
jsonschema-specifications==2025.4.1
@@ -77,7 +77,7 @@ mmh3==5.1.0
7777
mock==5.2.0
7878
mpmath==1.3.0
7979
multidict==6.4.4
80-
networkx==3.4.2
80+
networkx==3.5
8181
numpy==2.2.6
8282
oauthlib==3.2.2
8383
onnxruntime==1.22.0
@@ -107,7 +107,7 @@ pluggy==1.6.0
107107
posthog==4.2.0
108108
prompt-toolkit==3.0.51
109109
propcache==0.3.1
110-
protobuf==5.29.4
110+
protobuf==5.29.5
111111
ptyprocess==0.7.0
112112
pure-eval==0.2.3
113113
pyasn1==0.6.1
@@ -120,7 +120,7 @@ pyjwt==2.10.1
120120
pypdfium2==4.30.1
121121
pypika==0.48.9
122122
pyproject-hooks==1.2.0
123-
pytest==8.3.5
123+
pytest==8.4.0
124124
pytest-asyncio==1.0.0
125125
pytest-cov==6.1.1
126126
pytest-mock==3.14.1
@@ -150,11 +150,11 @@ tomli-w==1.2.0
150150
tqdm==4.67.1
151151
traitlets==5.14.3
152152
typer==0.16.0
153-
typing-extensions==4.13.2
153+
typing-extensions==4.14.0
154154
typing-inspection==0.4.1
155155
urllib3==2.4.0
156-
uv==0.7.8
157-
uvicorn[standard]==0.34.2
156+
uv==0.7.9
157+
uvicorn[standard]==0.34.3
158158
uvloop==0.21.0
159159
vcrpy==7.0.0
160160
watchfiles==1.0.5

.riot/requirements/1671e93.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1671e93.in
66
#
77
attrs==25.3.0
8-
coverage[toml]==7.8.0
8+
coverage[toml]==7.8.2
99
exceptiongroup==1.3.0
1010
gevent==25.5.1
1111
greenlet==3.2.2
@@ -16,20 +16,21 @@ lz4==4.4.4
1616
mock==5.2.0
1717
opentracing==2.4.0
1818
packaging==25.0
19-
pluggy==1.5.0
19+
pluggy==1.6.0
2020
py-cpuinfo==8.0.0
21-
pytest==8.3.5
21+
pygments==2.19.1
22+
pytest==8.4.0
2223
pytest-asyncio==0.21.1
2324
pytest-benchmark==5.1.0
2425
pytest-cov==6.1.1
25-
pytest-mock==3.14.0
26+
pytest-mock==3.14.1
2627
pytest-randomly==3.16.0
2728
sortedcontainers==2.4.0
2829
tomli==2.2.1
29-
typing-extensions==4.13.2
30-
uwsgi==2.0.29
30+
typing-extensions==4.14.0
31+
uwsgi==2.0.30
3132
zope-event==5.0
3233
zope-interface==7.2
3334

3435
# The following packages are considered to be unsafe in a requirements file:
35-
setuptools==80.4.0
36+
setuptools==80.9.0

.riot/requirements/175a6ba.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
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/175a6ba.in
5+
# pip-compile --allow-unsafe --no-annotate --resolver=backtracking .riot/requirements/175a6ba.in
66
#
77
attrs==25.3.0
8-
coverage[toml]==7.8.1
8+
coverage[toml]==7.8.2
99
exceptiongroup==1.3.0
1010
hypothesis==6.45.0
1111
iniconfig==2.1.0
1212
mock==5.2.0
1313
opentracing==2.4.0
1414
packaging==25.0
1515
pluggy==1.6.0
16-
pytest==8.3.5
16+
pygments==2.19.1
17+
pytest==8.4.0
1718
pytest-cov==6.1.1
18-
pytest-mock==3.14.0
19+
pytest-mock==3.14.1
1920
sortedcontainers==2.4.0
2021
tomli==2.2.1
21-
typing-extensions==4.13.2
22+
typing-extensions==4.14.0

0 commit comments

Comments
 (0)