Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21c23cb commit c4e28b9Copy full SHA for c4e28b9
opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
@@ -373,11 +373,15 @@ def _create_immutable_attributes(attributes):
373
374
def _check_span_ended(func):
375
def wrapper(self, *args, **kwargs):
376
+ already_ended = False
377
with self._lock: # pylint: disable=protected-access
- if self.end_time is not None:
378
- logger.warning("Calling %s on an ended span.", func.__name__)
379
- return
380
- func(self, *args, **kwargs)
+ if self.end_time is None:
+ func(self, *args, **kwargs)
+ else:
381
+ already_ended = True
382
+
383
+ if already_ended:
384
+ logger.warning("Tried calling %s on an ended span.", func.__name__)
385
386
return wrapper
387
0 commit comments