Skip to content

Commit b8c8148

Browse files
authored
Test back to OpenTelemetry SDK 1.30 (#1125)
1 parent 8a04229 commit b8c8148

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

.github/workflows/daily_deps_test.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,56 @@ on:
77
# Can be triggered manually from the actions tab, if needed
88
workflow_dispatch:
99

10+
1011
jobs:
1112
test:
12-
name: test on Python ${{ matrix.python-version }} and pydantic ${{ matrix.pydantic-version }}
13+
name: test on Python ${{ matrix.python-version }}, pydantic ${{ matrix.pydantic-version }}, otel ${{ matrix.otel-version }}
1314
runs-on: ubuntu-latest
1415
strategy:
1516
fail-fast: false
1617
matrix:
1718
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1819
pydantic-version: ['main']
20+
otel-version: ['1'] # i.e. the latest
1921
include:
22+
# Pydantic versions
2023
- python-version: '3.12'
2124
pydantic-version: '2.4'
25+
otel-version: '1'
2226
- python-version: '3.12'
2327
pydantic-version: '2.5'
28+
otel-version: '1'
2429
- python-version: '3.12'
2530
pydantic-version: '2.6'
31+
otel-version: '1'
2632
- python-version: '3.12'
2733
pydantic-version: '2.7'
34+
otel-version: '1'
2835
- python-version: '3.13'
2936
pydantic-version: '2.8'
37+
otel-version: '1'
3038
- python-version: '3.13'
3139
pydantic-version: '2.9'
40+
otel-version: '1'
3241
- python-version: '3.13'
3342
pydantic-version: '2.10'
43+
otel-version: '1'
3444
- python-version: '3.13'
3545
pydantic-version: '2.11'
46+
otel-version: '1'
47+
# OpenTelemetry versions
48+
- python-version: '3.13'
49+
pydantic-version: 'main'
50+
otel-version: '1.33'
51+
- python-version: '3.13'
52+
pydantic-version: 'main'
53+
otel-version: '1.32'
54+
- python-version: '3.13'
55+
pydantic-version: 'main'
56+
otel-version: '1.31'
57+
- python-version: '3.13'
58+
pydantic-version: 'main'
59+
otel-version: '1.30'
3660
env:
3761
PYTHON: ${{ matrix.python-version }}
3862
steps:
@@ -59,6 +83,12 @@ jobs:
5983
# installs the most recent patch on the minor version's track, ex 2.6.0 -> 2.6.4
6084
run: uv pip install 'pydantic==${{ matrix.pydantic-version }}.*'
6185

86+
- name: Install OTel SDK ${{ matrix.otel-version }}
87+
# installs the most recent patch on the minor version's track, ex 2.6.* -> 2.6.4
88+
run: |
89+
uv pip install 'opentelemetry-sdk==${{ matrix.otel-version }}.*'
90+
uv pip install 'opentelemetry-exporter-otlp-proto-http==${{ matrix.otel-version }}.*'
91+
6292
- run: uv run --no-sync pytest
6393

6494
notify-on-failure:

.github/workflows/main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ jobs:
6868
- python-version: '3.12'
6969
pydantic-version: '2.4'
7070
otel-version: '1' # i.e. the latest
71-
- python-version: '3.12'
71+
- python-version: '3.13'
7272
pydantic-version: '2' # i.e. the latest
73-
otel-version: '1.33'
73+
otel-version: '1.30'
7474
env:
7575
PYTHON: ${{ matrix.python-version }}
7676
steps:
@@ -97,7 +97,9 @@ jobs:
9797

9898
- name: Install OTel SDK ${{ matrix.otel-version }}
9999
# installs the most recent patch on the minor version's track, ex 2.6.* -> 2.6.4
100-
run: uv pip install 'opentelemetry-sdk==${{ matrix.otel-version }}.*'
100+
run: |
101+
uv pip install 'opentelemetry-sdk==${{ matrix.otel-version }}.*'
102+
uv pip install 'opentelemetry-exporter-otlp-proto-http==${{ matrix.otel-version }}.*'
101103
102104
- run: mkdir coverage
103105
- run: uv run --no-sync coverage run -m pytest --junitxml=coverage/test-results.xml

tests/test_logfire_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def func() -> None: ...
171171
logfire__all__.remove('instrument_pydantic_ai')
172172

173173
assert hasattr(logfire_api, 'instrument_mcp')
174-
if sys.version_info >= (3, 10) and not pydantic_pre_2_5:
174+
if sys.version_info >= (3, 10) and get_version(pydantic_version) >= get_version('2.7.0'):
175175
logfire_api.instrument_mcp()
176176
logfire__all__.remove('instrument_mcp')
177177

0 commit comments

Comments
 (0)