Commit 3f69b56
committed
Enhance OpenAI instrumentation with new response handling and telemetry support
- Added `opentelemetry-util-genai` as a dependency for improved telemetry handling.
- Refactored response handling in `patch_responses.py` to utilize `TelemetryHandler` for tracing.
- Updated `responses_create` and `responses_retrieve` methods to integrate new telemetry features.
- Simplified imports and removed unused code in `__init__.py`.
- Added extensive test cases and YAML cassettes for various response scenarios, including streaming and standard responses.
- Adjusted requirements files to include the new utility package for testing.1 parent 5e26cdd commit 3f69b56
11 files changed
Lines changed: 3997 additions & 387 deletions
File tree
- instrumentation-genai/opentelemetry-instrumentation-openai-v2
- src/opentelemetry/instrumentation/openai_v2
- tests
- cassettes
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
Lines changed: 13 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 63 | + | |
68 | 64 | | |
69 | 65 | | |
70 | 66 | | |
| |||
136 | 132 | | |
137 | 133 | | |
138 | 134 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
148 | 146 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 147 | + | |
| 148 | + | |
153 | 149 | | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
157 | 153 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 154 | + | |
161 | 155 | | |
162 | 156 | | |
163 | | - | |
| 157 | + | |
164 | 158 | | |
165 | 159 | | |
166 | 160 | | |
| |||
175 | 169 | | |
176 | 170 | | |
177 | 171 | | |
178 | | - | |
179 | 172 | | |
180 | 173 | | |
181 | 174 | | |
| |||
0 commit comments