Permalink
Browse files

fix crash when not using opencensus

  • Loading branch information...
Roguelazer authored and geobeau committed Jan 3, 2019
1 parent 683ed9c commit 3eccea0614b6433423bc1f02424e30a37331324b
Showing with 2 additions and 2 deletions.
  1. +2 −2 biggraphite/tracing.py
@@ -46,7 +46,7 @@ def tracer(self, *args, **kwargs):
def stop_trace():
"""Stop the current trace."""
if not execution_context:
pass
return
execution_context.set_current_span(None)
tracer = execution_context.get_opencensus_tracer()
tracer.tracer = noop_tracer.NoopTracer()
@@ -57,7 +57,7 @@ def stop_trace():
def add_attr_to_trace(key, value):
"""Add an attribute to the current span if tracing is enabled."""
if not execution_context:
pass
return
tracer = execution_context.get_opencensus_tracer()
tracer.add_attribute_to_current_span(
attribute_key=key,

0 comments on commit 3eccea0

Please sign in to comment.