Skip to content

Commit

Permalink
🐛Fix opentelemetry detach bug (ITISFoundation#6941)
Browse files Browse the repository at this point in the history
  • Loading branch information
bisgaard-itis authored Dec 11, 2024
1 parent 92ddd6c commit 791d9d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/service-library/src/servicelib/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ def get_context() -> TracingContext:

@contextmanager
def use_tracing_context(context: TracingContext):
token: object | None = None
if context is not None:
otcontext.attach(context)
token = otcontext.attach(context)
try:
yield
finally:
if context is not None:
otcontext.detach(context)
if token is not None:
otcontext.detach(token)


def setup_log_tracing(tracing_settings: TracingSettings):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10636,7 +10636,7 @@ components:
read: true
write: false
description: Open to all users
gid: '0'
gid: 1
label: All
me:
accessRights:
Expand Down

0 comments on commit 791d9d1

Please sign in to comment.