Commit 0bf9572
authored
otlp: Clients to close body uniformly (#5954)
There were inconsistencies in closing the response body. For traces, the
Close happened in a defer statement and any error was logged. Logs and
metrics were less rigorous. It appeared Close() wasn't always called,
and when it was, errors were returned sometimes and ignored at other
times.
This applies the defer logic from traces to the other two and removes
other Close() calls.
This was part of PR #5929, and has been split out as
requested:
#5929 (comment)).1 parent ac5caea commit 0bf9572
File tree
4 files changed
+20
-9
lines changed- exporters/otlp
- otlplog/otlploghttp
- otlpmetric/otlpmetrichttp
- otlptrace/otlptracehttp
4 files changed
+20
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
152 | 159 | | |
153 | 160 | | |
154 | 161 | | |
| |||
193 | 200 | | |
194 | 201 | | |
195 | 202 | | |
196 | | - | |
197 | 203 | | |
198 | 204 | | |
199 | 205 | | |
| |||
208 | 214 | | |
209 | 215 | | |
210 | 216 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| |||
196 | 203 | | |
197 | 204 | | |
198 | 205 | | |
199 | | - | |
200 | 206 | | |
201 | 207 | | |
202 | 208 | | |
| |||
211 | 217 | | |
212 | 218 | | |
213 | 219 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
| |||
0 commit comments