Skip to content

Commit d34a7fc

Browse files
joshowenemdnetoxrmx
committed
psycopg2-binary support (open-telemetry#3186)
* psycopg2-binary support * changelog * Update CHANGELOG.md * Update pyproject.toml * fix * lint * added test config * Update bootstrap_gen.py * update tox * Update tox.ini * regenerate workflows * workflows --------- Co-authored-by: Emídio Neto <[email protected]> Co-authored-by: Riccardo Magliocchetti <[email protected]>
1 parent 5edd741 commit d34a7fc

File tree

11 files changed

+296
-111
lines changed

11 files changed

+296
-111
lines changed

Diff for: .github/workflows/core_contrib_test_0.yml

+22
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,28 @@ jobs:
10751075
- name: Run tests
10761076
run: tox -e py38-test-instrumentation-psycopg2 -- -ra
10771077

1078+
py38-test-instrumentation-psycopg2-binary:
1079+
name: instrumentation-psycopg2-binary
1080+
runs-on: ubuntu-latest
1081+
steps:
1082+
- name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }}
1083+
uses: actions/checkout@v4
1084+
with:
1085+
repository: open-telemetry/opentelemetry-python-contrib
1086+
ref: ${{ env.CONTRIB_REPO_SHA }}
1087+
1088+
- name: Set up Python 3.8
1089+
uses: actions/setup-python@v5
1090+
with:
1091+
python-version: "3.8"
1092+
architecture: "x64"
1093+
1094+
- name: Install tox
1095+
run: pip install tox-uv
1096+
1097+
- name: Run tests
1098+
run: tox -e py38-test-instrumentation-psycopg2-binary -- -ra
1099+
10781100
py38-test-instrumentation-psycopg:
10791101
name: instrumentation-psycopg
10801102
runs-on: ubuntu-latest

Diff for: .github/workflows/test_1.yml

+108-108
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,114 @@ jobs:
12221222
- name: Run tests
12231223
run: tox -e py313-test-instrumentation-psycopg2 -- -ra
12241224

1225+
py38-test-instrumentation-psycopg2-binary_ubuntu-latest:
1226+
name: instrumentation-psycopg2-binary 3.8 Ubuntu
1227+
runs-on: ubuntu-latest
1228+
steps:
1229+
- name: Checkout repo @ SHA - ${{ github.sha }}
1230+
uses: actions/checkout@v4
1231+
1232+
- name: Set up Python 3.8
1233+
uses: actions/setup-python@v5
1234+
with:
1235+
python-version: "3.8"
1236+
1237+
- name: Install tox
1238+
run: pip install tox-uv
1239+
1240+
- name: Run tests
1241+
run: tox -e py38-test-instrumentation-psycopg2-binary -- -ra
1242+
1243+
py39-test-instrumentation-psycopg2-binary_ubuntu-latest:
1244+
name: instrumentation-psycopg2-binary 3.9 Ubuntu
1245+
runs-on: ubuntu-latest
1246+
steps:
1247+
- name: Checkout repo @ SHA - ${{ github.sha }}
1248+
uses: actions/checkout@v4
1249+
1250+
- name: Set up Python 3.9
1251+
uses: actions/setup-python@v5
1252+
with:
1253+
python-version: "3.9"
1254+
1255+
- name: Install tox
1256+
run: pip install tox-uv
1257+
1258+
- name: Run tests
1259+
run: tox -e py39-test-instrumentation-psycopg2-binary -- -ra
1260+
1261+
py310-test-instrumentation-psycopg2-binary_ubuntu-latest:
1262+
name: instrumentation-psycopg2-binary 3.10 Ubuntu
1263+
runs-on: ubuntu-latest
1264+
steps:
1265+
- name: Checkout repo @ SHA - ${{ github.sha }}
1266+
uses: actions/checkout@v4
1267+
1268+
- name: Set up Python 3.10
1269+
uses: actions/setup-python@v5
1270+
with:
1271+
python-version: "3.10"
1272+
1273+
- name: Install tox
1274+
run: pip install tox-uv
1275+
1276+
- name: Run tests
1277+
run: tox -e py310-test-instrumentation-psycopg2-binary -- -ra
1278+
1279+
py311-test-instrumentation-psycopg2-binary_ubuntu-latest:
1280+
name: instrumentation-psycopg2-binary 3.11 Ubuntu
1281+
runs-on: ubuntu-latest
1282+
steps:
1283+
- name: Checkout repo @ SHA - ${{ github.sha }}
1284+
uses: actions/checkout@v4
1285+
1286+
- name: Set up Python 3.11
1287+
uses: actions/setup-python@v5
1288+
with:
1289+
python-version: "3.11"
1290+
1291+
- name: Install tox
1292+
run: pip install tox-uv
1293+
1294+
- name: Run tests
1295+
run: tox -e py311-test-instrumentation-psycopg2-binary -- -ra
1296+
1297+
py312-test-instrumentation-psycopg2-binary_ubuntu-latest:
1298+
name: instrumentation-psycopg2-binary 3.12 Ubuntu
1299+
runs-on: ubuntu-latest
1300+
steps:
1301+
- name: Checkout repo @ SHA - ${{ github.sha }}
1302+
uses: actions/checkout@v4
1303+
1304+
- name: Set up Python 3.12
1305+
uses: actions/setup-python@v5
1306+
with:
1307+
python-version: "3.12"
1308+
1309+
- name: Install tox
1310+
run: pip install tox-uv
1311+
1312+
- name: Run tests
1313+
run: tox -e py312-test-instrumentation-psycopg2-binary -- -ra
1314+
1315+
py313-test-instrumentation-psycopg2-binary_ubuntu-latest:
1316+
name: instrumentation-psycopg2-binary 3.13 Ubuntu
1317+
runs-on: ubuntu-latest
1318+
steps:
1319+
- name: Checkout repo @ SHA - ${{ github.sha }}
1320+
uses: actions/checkout@v4
1321+
1322+
- name: Set up Python 3.13
1323+
uses: actions/setup-python@v5
1324+
with:
1325+
python-version: "3.13"
1326+
1327+
- name: Install tox
1328+
run: pip install tox-uv
1329+
1330+
- name: Run tests
1331+
run: tox -e py313-test-instrumentation-psycopg2-binary -- -ra
1332+
12251333
py38-test-instrumentation-psycopg_ubuntu-latest:
12261334
name: instrumentation-psycopg 3.8 Ubuntu
12271335
runs-on: ubuntu-latest
@@ -4407,111 +4515,3 @@ jobs:
44074515

44084516
- name: Run tests
44094517
run: tox -e py38-test-util-http -- -ra
4410-
4411-
py39-test-util-http_ubuntu-latest:
4412-
name: util-http 3.9 Ubuntu
4413-
runs-on: ubuntu-latest
4414-
steps:
4415-
- name: Checkout repo @ SHA - ${{ github.sha }}
4416-
uses: actions/checkout@v4
4417-
4418-
- name: Set up Python 3.9
4419-
uses: actions/setup-python@v5
4420-
with:
4421-
python-version: "3.9"
4422-
4423-
- name: Install tox
4424-
run: pip install tox-uv
4425-
4426-
- name: Run tests
4427-
run: tox -e py39-test-util-http -- -ra
4428-
4429-
py310-test-util-http_ubuntu-latest:
4430-
name: util-http 3.10 Ubuntu
4431-
runs-on: ubuntu-latest
4432-
steps:
4433-
- name: Checkout repo @ SHA - ${{ github.sha }}
4434-
uses: actions/checkout@v4
4435-
4436-
- name: Set up Python 3.10
4437-
uses: actions/setup-python@v5
4438-
with:
4439-
python-version: "3.10"
4440-
4441-
- name: Install tox
4442-
run: pip install tox-uv
4443-
4444-
- name: Run tests
4445-
run: tox -e py310-test-util-http -- -ra
4446-
4447-
py311-test-util-http_ubuntu-latest:
4448-
name: util-http 3.11 Ubuntu
4449-
runs-on: ubuntu-latest
4450-
steps:
4451-
- name: Checkout repo @ SHA - ${{ github.sha }}
4452-
uses: actions/checkout@v4
4453-
4454-
- name: Set up Python 3.11
4455-
uses: actions/setup-python@v5
4456-
with:
4457-
python-version: "3.11"
4458-
4459-
- name: Install tox
4460-
run: pip install tox-uv
4461-
4462-
- name: Run tests
4463-
run: tox -e py311-test-util-http -- -ra
4464-
4465-
py312-test-util-http_ubuntu-latest:
4466-
name: util-http 3.12 Ubuntu
4467-
runs-on: ubuntu-latest
4468-
steps:
4469-
- name: Checkout repo @ SHA - ${{ github.sha }}
4470-
uses: actions/checkout@v4
4471-
4472-
- name: Set up Python 3.12
4473-
uses: actions/setup-python@v5
4474-
with:
4475-
python-version: "3.12"
4476-
4477-
- name: Install tox
4478-
run: pip install tox-uv
4479-
4480-
- name: Run tests
4481-
run: tox -e py312-test-util-http -- -ra
4482-
4483-
py313-test-util-http_ubuntu-latest:
4484-
name: util-http 3.13 Ubuntu
4485-
runs-on: ubuntu-latest
4486-
steps:
4487-
- name: Checkout repo @ SHA - ${{ github.sha }}
4488-
uses: actions/checkout@v4
4489-
4490-
- name: Set up Python 3.13
4491-
uses: actions/setup-python@v5
4492-
with:
4493-
python-version: "3.13"
4494-
4495-
- name: Install tox
4496-
run: pip install tox-uv
4497-
4498-
- name: Run tests
4499-
run: tox -e py313-test-util-http -- -ra
4500-
4501-
pypy3-test-util-http_ubuntu-latest:
4502-
name: util-http pypy-3.8 Ubuntu
4503-
runs-on: ubuntu-latest
4504-
steps:
4505-
- name: Checkout repo @ SHA - ${{ github.sha }}
4506-
uses: actions/checkout@v4
4507-
4508-
- name: Set up Python pypy-3.8
4509-
uses: actions/setup-python@v5
4510-
with:
4511-
python-version: "pypy-3.8"
4512-
4513-
- name: Install tox
4514-
run: pip install tox-uv
4515-
4516-
- name: Run tests
4517-
run: tox -e pypy3-test-util-http -- -ra

Diff for: .github/workflows/test_2.yml

+108
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,114 @@ env:
1616

1717
jobs:
1818

19+
py39-test-util-http_ubuntu-latest:
20+
name: util-http 3.9 Ubuntu
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repo @ SHA - ${{ github.sha }}
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python 3.9
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.9"
30+
31+
- name: Install tox
32+
run: pip install tox-uv
33+
34+
- name: Run tests
35+
run: tox -e py39-test-util-http -- -ra
36+
37+
py310-test-util-http_ubuntu-latest:
38+
name: util-http 3.10 Ubuntu
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout repo @ SHA - ${{ github.sha }}
42+
uses: actions/checkout@v4
43+
44+
- name: Set up Python 3.10
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.10"
48+
49+
- name: Install tox
50+
run: pip install tox-uv
51+
52+
- name: Run tests
53+
run: tox -e py310-test-util-http -- -ra
54+
55+
py311-test-util-http_ubuntu-latest:
56+
name: util-http 3.11 Ubuntu
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Checkout repo @ SHA - ${{ github.sha }}
60+
uses: actions/checkout@v4
61+
62+
- name: Set up Python 3.11
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: "3.11"
66+
67+
- name: Install tox
68+
run: pip install tox-uv
69+
70+
- name: Run tests
71+
run: tox -e py311-test-util-http -- -ra
72+
73+
py312-test-util-http_ubuntu-latest:
74+
name: util-http 3.12 Ubuntu
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout repo @ SHA - ${{ github.sha }}
78+
uses: actions/checkout@v4
79+
80+
- name: Set up Python 3.12
81+
uses: actions/setup-python@v5
82+
with:
83+
python-version: "3.12"
84+
85+
- name: Install tox
86+
run: pip install tox-uv
87+
88+
- name: Run tests
89+
run: tox -e py312-test-util-http -- -ra
90+
91+
py313-test-util-http_ubuntu-latest:
92+
name: util-http 3.13 Ubuntu
93+
runs-on: ubuntu-latest
94+
steps:
95+
- name: Checkout repo @ SHA - ${{ github.sha }}
96+
uses: actions/checkout@v4
97+
98+
- name: Set up Python 3.13
99+
uses: actions/setup-python@v5
100+
with:
101+
python-version: "3.13"
102+
103+
- name: Install tox
104+
run: pip install tox-uv
105+
106+
- name: Run tests
107+
run: tox -e py313-test-util-http -- -ra
108+
109+
pypy3-test-util-http_ubuntu-latest:
110+
name: util-http pypy-3.8 Ubuntu
111+
runs-on: ubuntu-latest
112+
steps:
113+
- name: Checkout repo @ SHA - ${{ github.sha }}
114+
uses: actions/checkout@v4
115+
116+
- name: Set up Python pypy-3.8
117+
uses: actions/setup-python@v5
118+
with:
119+
python-version: "pypy-3.8"
120+
121+
- name: Install tox
122+
run: pip install tox-uv
123+
124+
- name: Run tests
125+
run: tox -e pypy3-test-util-http -- -ra
126+
19127
py38-test-propagator-aws-xray-0_ubuntu-latest:
20128
name: propagator-aws-xray-0 3.8 Ubuntu
21129
runs-on: ubuntu-latest

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3939
([#3129](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3129))
4040
- `opentelemetry-util-http` Add `py.typed` file to enable PEP 561
4141
([#3127](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3127))
42+
- `opentelemetry-instrumentation-psycopg2` Add support for psycopg2-binary
43+
([#3186](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3186))
4244
- `opentelemetry-opentelemetry-botocore` Add basic support for GenAI attributes for AWS Bedrock Converse API
4345
([#3161](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3161))
4446

Diff for: instrumentation/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
| [opentelemetry-instrumentation-mysqlclient](./opentelemetry-instrumentation-mysqlclient) | mysqlclient < 3 | No | experimental
3333
| [opentelemetry-instrumentation-pika](./opentelemetry-instrumentation-pika) | pika >= 0.12.0 | No | experimental
3434
| [opentelemetry-instrumentation-psycopg](./opentelemetry-instrumentation-psycopg) | psycopg >= 3.1.0 | No | experimental
35-
| [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1 | No | experimental
35+
| [opentelemetry-instrumentation-psycopg2](./opentelemetry-instrumentation-psycopg2) | psycopg2 >= 2.7.3.1,psycopg2-binary >= 2.7.3.1 | No | experimental
3636
| [opentelemetry-instrumentation-pymemcache](./opentelemetry-instrumentation-pymemcache) | pymemcache >= 1.3.5, < 5 | No | experimental
3737
| [opentelemetry-instrumentation-pymongo](./opentelemetry-instrumentation-pymongo) | pymongo >= 3.1, < 5.0 | No | experimental
3838
| [opentelemetry-instrumentation-pymysql](./opentelemetry-instrumentation-pymysql) | PyMySQL < 2 | No | experimental

Diff for: instrumentation/opentelemetry-instrumentation-psycopg2/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dependencies = [
3434
[project.optional-dependencies]
3535
instruments = [
3636
"psycopg2 >= 2.7.3.1",
37+
"psycopg2-binary >= 2.7.3.1",
3738
]
3839

3940
[project.entry-points.opentelemetry_instrumentor]

0 commit comments

Comments
 (0)