Skip to content

Commit 98ec407

Browse files
committed
update comment
Signed-off-by: Alex Boten <[email protected]>
1 parent d2299a9 commit 98ec407

File tree

1 file changed

+4
-4
lines changed
  • exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter

1 file changed

+4
-4
lines changed

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ def _export(self, serialized_data: bytes):
176176
elif self._compression == Compression.Deflate:
177177
data = zlib.compress(serialized_data)
178178

179+
# By default, keep-alive is enabled in Session's request
180+
# headers. Backends may choose to close the connection
181+
# while a post happens which causes an unhandled
182+
# exception. This try/except will retry the post on such exceptions
179183
try:
180184
resp = self._session.post(
181185
url=self._endpoint,
@@ -185,10 +189,6 @@ def _export(self, serialized_data: bytes):
185189
cert=self._client_cert,
186190
)
187191
except ConnectionError:
188-
# By default, keep-alive is set in Session's request
189-
# headers. Backends may choose to close the connection
190-
# while a post happens which causes an unhandled
191-
# exception. This try/except will retry the post on such exceptions
192192
resp = self._session.post(
193193
url=self._endpoint,
194194
data=data,

0 commit comments

Comments
 (0)