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
I'd like to have access to the span generated by the decorator. eg of how I'm hoping to use it:
@logfire.instrument()
def lf_example():
result = do_some_things()
if result:
# Set an attribute on the current logfire span from the decorator
logfire.set_attribute(status='OK')
else:
logfire.set_attribute(status='ERROR')
An idea explored on Slack was to use otel apis:
from opentelemetry.trace.propagation import get_current_span
get_current_span().set_attribute(...)
But it seems that the otel apis don't work with non-primatives.
An idea was to add a logfire.get_current_span api that would get the LogfireSpan instance.
The text was updated successfully, but these errors were encountered:
Description
(as discussed on Slack)
I'd like to have access to the span generated by the decorator. eg of how I'm hoping to use it:
An idea explored on Slack was to use otel apis:
But it seems that the otel apis don't work with non-primatives.
An idea was to add a
logfire.get_current_span
api that would get the LogfireSpan instance.The text was updated successfully, but these errors were encountered: