You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py
Copy file name to clipboardExpand all lines: instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py
# NOTE: `force_flush` before function quit in case of Lambda freeze.
358
-
# Assumes we are using the OpenTelemetry SDK implementation of the
359
-
# `TracerProvider`.
360
-
_tracer_provider.force_flush(flush_timeout)
361
-
exceptException: # pylint: disable=broad-except
362
-
logger.error(
363
-
"TracerProvider was missing `force_flush` method. This is necessary in case of a Lambda freeze and would exist in the OTel SDK implementation."
364
+
ifhasattr(_tracer_provider, "force_flush"):
365
+
try:
366
+
# NOTE: `force_flush` before function quit in case of Lambda freeze.
367
+
_tracer_provider.force_flush(flush_timeout)
368
+
exceptException: # pylint: disable=broad-except
369
+
logger.exception(
370
+
f"TracerProvider failed to flush traces"
371
+
)
372
+
else:
373
+
logger.warning("TracerProvider was missing `force_flush` method. This is necessary in case of a Lambda freeze and would exist in the OTel SDK implementation.")
0 commit comments