Skip to content

Commit b8aab3a

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/remove-suppress-language-model-key
2 parents 49d4120 + f8269ad commit b8aab3a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • instrumentation-genai/opentelemetry-instrumentation-openai-v2

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

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

88
## Unreleased
99

10+
### Fixed
11+
12+
- Fix `AttributeError: 'StreamWrapper' object has no attribute 'headers'` when
13+
using `with_raw_response.create(stream=True)` (e.g. via LiteLLM's Azure provider).
14+
`_parse_response` was calling `.parse()` on the `LegacyAPIResponse` before wrapping
15+
in `StreamWrapper`, discarding the raw HTTP headers. `StreamWrapper` now captures
16+
headers from the `LegacyAPIResponse` before it is parsed and exposes them directly,
17+
and adds a `parse()` method returning `self` so callers can treat the wrapper as
18+
a drop-in for the raw response. Also adds `__getattr__` to proxy any other unknown
19+
attributes to the underlying stream. Inspired by upstream fix
20+
([opentelemetry-python-contrib#4184](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4184),
21+
fixes [#4113](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/4113)).
22+
1023
### Added
1124
- **`SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION` env var** — Global alternative to
1225
the per-request `suppress_language_model_instrumentation` OTel context key.

0 commit comments

Comments
 (0)