In certain cases an opentracing-utils user might need to skip @trace spans based on custom logic.
Suggested usage example:
def skip_span_logic(*args, **kwargs):
if 'something' in kwargs:
# @trace should not add a new span
return True
# @trace should add a new span
return False
@trace(skip_span=skip_span_logic)
def trace_me(*args, **kwargs):
# do stuff
This could be helpful in the case of trace_requests(ignore_url_patterns=[...]), since the skip_span func could inform @trace whether to add a span or not.
In certain cases an opentracing-utils user might need to skip
@trace
spans based on custom logic.Suggested usage example:
This could be helpful in the case of
trace_requests(ignore_url_patterns=[...])
, since theskip_span
func could inform@trace
whether to add a span or not.