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 like being able to use zipkin_span as a decorator, but it means that I currently can't use update_binary_annotations without converting it to a contextmanager, since I need access to the zipkin_context variable.
E.g. from the docs:
defsome_function(a, b):
withzipkin_span(
service_name='my_service',
span_name='some_function',
transport_handler=some_handler,
port=42,
sample_rate=0.05,
) aszipkin_context:
result=do_stuff(a, b)
# Can add stuff here!zipkin_context.update_binary_annotations({'result': result})
vs.
@zipkin_span(service_name='my_service',span_name='some_function',transport_handler=some_handler,port=42,sample_rate=0.05,)defsome_function(a, b):
result=do_stuff(a, b)
# No access to zipkin_context :(zipkin_context.update_binary_annotations({'result': result})
Perhaps a way to solve this would be to add a flag to zipkin_span such as inject_context, which would pass the zipkin_context object to the wrapped function? Then my some_function could receive it as a kwarg.
The text was updated successfully, but these errors were encountered:
I like being able to use
zipkin_span
as a decorator, but it means that I currently can't useupdate_binary_annotations
without converting it to a contextmanager, since I need access to thezipkin_context
variable.E.g. from the docs:
vs.
Perhaps a way to solve this would be to add a flag to
zipkin_span
such asinject_context
, which would pass thezipkin_context
object to the wrapped function? Then mysome_function
could receive it as a kwarg.The text was updated successfully, but these errors were encountered: