Skip to content

Commit b59a192

Browse files
authored
Merge branch 'main' into anthropic-async
2 parents 5ecca77 + 93bea2d commit b59a192

30 files changed

Lines changed: 5164 additions & 4164 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ repos:
1010
- id: ruff-format
1111
- repo: https://github.com/astral-sh/uv-pre-commit
1212
# uv version.
13-
rev: 0.6.0
13+
rev: 1ce7e7fa8aa6eda60e54755509a9380b0f1c5d08 # frozen: v0.9.30
1414
hooks:
1515
- id: uv-lock
16+
args: ["--index-url", "https://pypi.org/simple/"]
1617
- repo: https://github.com/rstcheck/rstcheck
1718
rev: 77490ffa33bfc0928975ae3cf904219903db755d # frozen: v6.2.5
1819
hooks:

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
104104
([#3922](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3922))
105105
- `opentelemetry-instrumentation-urllib3`: fix multiple arguments error
106106
([#4144](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4144))
107+
- `opentelemetry-instrumentation-psycopg`: Fix instrument of typed psycopg sql
108+
([#4078](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4171))
107109
- `opentelemetry-instrumentation-aiohttp-server`: fix HTTP error inconsistencies
108110
([#4175](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4175))
109111

@@ -112,7 +114,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
112114
- `opentelemetry-instrumentation-logging`: Inject span context attributes into logging LogRecord only if configured to do so
113115
([#4112](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4112))
114116
- `opentelemetry-instrumentation-django`: Drop support for Django < 2.0
115-
([#3848](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4083))
117+
([#4083](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4083))
116118

117119
## Version 1.39.0/0.60b0 (2025-12-03)
118120

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ For more information about the maintainer role, see the [community repository](h
126126
- [Héctor Hernández](https://github.com/hectorhdzg), Microsoft
127127
- [Jeremy Voss](https://github.com/jeremydvoss), Microsoft
128128
- [Liudmila Molkova](https://github.com/lmolkova), Grafana Labs
129+
- [Lukas Hering](https://github.com/herin049), Capital One
129130
- [Owais Lone](https://github.com/owais), Splunk
130131
- [Pablo Collins](https://github.com/pmcollins), Splunk
131132
- [Sanket Mehta](https://github.com/sanketmehta28), Cisco

docs-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ sphinx==7.1.2
22
sphinx-rtd-theme==2.0.0rc4
33
sphinx-autodoc-typehints==1.25.2
44

5+
# Required to avoid breakages for pyramid and cassandra packages
6+
setuptools<82.0.0
7+
58
# Required by opentelemetry-instrumentation
69
fastapi>=0.65.2
710
pymemcache~=1.3

instrumentation-genai/opentelemetry-instrumentation-openai-v2/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
- Fix `StreamWrapper` missing `.headers` and other attributes when using `with_raw_response` streaming
11+
([#4113](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4113))
12+
1013
## Version 2.3b0 (2025-12-24)
1114

1215
- Fix `AttributeError` when handling `LegacyAPIResponse` (from `with_raw_response`)

instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,9 @@ def process_chunk(self, chunk):
702702
self.build_streaming_response(chunk)
703703
self.set_usage(chunk)
704704

705+
def __getattr__(self, name):
706+
return getattr(self.stream, name)
707+
705708
def parse(self):
706709
"""Called when using with_raw_response with stream=True"""
707710
return self

instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/requirements.oldest.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
# This variant of the requirements aims to test the system using
1616
# the oldest supported version of external dependencies.
1717

18-
openai[datalib]==1.26.0
18+
openai==1.26.0
19+
numpy==2.1.0 ; python_version >= "3.10"
20+
numpy==2.0.0 ; python_version == "3.9"
1921
pydantic==2.8.2
2022
httpx==0.27.2
2123
Deprecated==1.2.14

instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ async def do_request():
9191
return loop.run_until_complete(do_request())
9292

9393

94+
SCOPE = "opentelemetry.instrumentation.aiohttp_client"
95+
96+
9497
# pylint: disable=too-many-public-methods
9598
class TestAioHttpIntegration(TestBase):
9699
_test_status_codes = (
@@ -122,7 +125,7 @@ def _assert_spans(self, spans, num_spans=1):
122125
)
123126

124127
def _assert_metrics(self, num_metrics: int = 1):
125-
metrics = self.get_sorted_metrics()
128+
metrics = self.get_sorted_metrics(SCOPE)
126129
self.assertEqual(len(metrics), num_metrics)
127130
return metrics
128131

@@ -1312,7 +1315,7 @@ def _assert_spans(self, num_spans: int):
13121315
return finished_spans
13131316

13141317
def _assert_metrics(self, num_metrics: int = 1):
1315-
metrics = self.get_sorted_metrics()
1318+
metrics = self.get_sorted_metrics(SCOPE)
13161319
self.assertEqual(len(metrics), num_metrics)
13171320
return metrics
13181321

instrumentation/opentelemetry-instrumentation-flask/tests/test_flask_compatibility.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,12 @@ def generate():
302302
"Flask 3.1+ streaming context cleanup only enabled on Python 3.10+",
303303
)
304304
@skipIf(
305-
lambda: not __import__(
306-
"opentelemetry.instrumentation.flask",
307-
fromlist=["_IS_FLASK_31_PLUS"],
308-
)._IS_FLASK_31_PLUS,
305+
lambda: (
306+
not __import__(
307+
"opentelemetry.instrumentation.flask",
308+
fromlist=["_IS_FLASK_31_PLUS"],
309+
)._IS_FLASK_31_PLUS
310+
),
309311
"Flask 3.1+ streaming context cleanup requires Flask 3.1+",
310312
)
311313
def test_flask_31_streaming_context_cleanup(self):

instrumentation/opentelemetry-instrumentation-httpx/tests/test_httpx_integration.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ async def _async_no_update_request_hook(span: "Span", request: "RequestInfo"):
142142

143143
# pylint: disable=too-many-public-methods
144144

145+
SCOPE = "opentelemetry.instrumentation.httpx"
146+
145147

146148
# Using this wrapper class to have a base class for the tests while also not
147149
# angering pylint or mypy when calling methods not in the class when only
@@ -205,7 +207,7 @@ def assert_span(
205207
return span_list
206208

207209
def assert_metrics(self, num_metrics: int = 1):
208-
metrics = self.get_sorted_metrics()
210+
metrics = self.get_sorted_metrics(SCOPE)
209211
self.assertEqual(len(metrics), num_metrics)
210212
return metrics
211213

@@ -244,7 +246,7 @@ def test_basic(self):
244246

245247
def test_basic_metrics(self):
246248
self.perform_request(self.URL)
247-
metrics = self.get_sorted_metrics()
249+
metrics = self.get_sorted_metrics(SCOPE)
248250
self.assertEqual(len(metrics), 1)
249251
duration_data_point = metrics[0].data.data_points[0]
250252
self.assertEqual(duration_data_point.count, 1)
@@ -289,7 +291,7 @@ def test_nonstandard_http_method(self):
289291
span, opentelemetry.instrumentation.httpx
290292
)
291293
# Validate metrics
292-
metrics = self.get_sorted_metrics()
294+
metrics = self.get_sorted_metrics(SCOPE)
293295
self.assertEqual(len(metrics), 1)
294296
duration_data_point = metrics[0].data.data_points[0]
295297
self.assertEqual(duration_data_point.count, 1)
@@ -331,7 +333,7 @@ def test_nonstandard_http_method_new_semconv(self):
331333
span, opentelemetry.instrumentation.httpx
332334
)
333335
# Validate metrics
334-
metrics = self.get_sorted_metrics()
336+
metrics = self.get_sorted_metrics(SCOPE)
335337
self.assertEqual(len(metrics), 1)
336338
duration_data_point = metrics[0].data.data_points[0]
337339
self.assertEqual(duration_data_point.count, 1)
@@ -391,7 +393,7 @@ def test_basic_new_semconv(self):
391393
)
392394

393395
# Validate metrics
394-
metrics = self.get_sorted_metrics()
396+
metrics = self.get_sorted_metrics(SCOPE)
395397
self.assertEqual(len(metrics), 1)
396398
duration_data_point = metrics[0].data.data_points[0]
397399
self.assertEqual(duration_data_point.count, 1)
@@ -448,7 +450,7 @@ def test_basic_both_semconv(self):
448450
)
449451

450452
# Validate metrics
451-
metrics = self.get_sorted_metrics()
453+
metrics = self.get_sorted_metrics(SCOPE)
452454
self.assertEqual(len(metrics), 2)
453455
# Old convention
454456
self.assertEqual(
@@ -497,7 +499,7 @@ def test_not_foundbasic(self):
497499
trace.StatusCode.ERROR,
498500
)
499501
# Validate metrics
500-
metrics = self.get_sorted_metrics()
502+
metrics = self.get_sorted_metrics(SCOPE)
501503
self.assertEqual(len(metrics), 1)
502504
duration_data_point = metrics[0].data.data_points[0]
503505
self.assertEqual(
@@ -525,7 +527,7 @@ def test_not_foundbasic_new_semconv(self):
525527
trace.StatusCode.ERROR,
526528
)
527529
# Validate metrics
528-
metrics = self.get_sorted_metrics()
530+
metrics = self.get_sorted_metrics(SCOPE)
529531
self.assertEqual(len(metrics), 1)
530532
duration_data_point = metrics[0].data.data_points[0]
531533
self.assertEqual(
@@ -556,7 +558,7 @@ def test_not_foundbasic_both_semconv(self):
556558
trace.StatusCode.ERROR,
557559
)
558560
# Validate metrics
559-
metrics = self.get_sorted_metrics()
561+
metrics = self.get_sorted_metrics(SCOPE)
560562
self.assertEqual(len(metrics), 2)
561563
# Old convention
562564
self.assertEqual(

0 commit comments

Comments
 (0)