diff --git a/biggraphite/drivers/elasticsearch.py b/biggraphite/drivers/elasticsearch.py index a7a4884846..f87b9ea53d 100644 --- a/biggraphite/drivers/elasticsearch.py +++ b/biggraphite/drivers/elasticsearch.py @@ -580,8 +580,6 @@ def glob_metrics(self, glob, start_time=None, end_time=None): super(_ElasticSearchAccessor, self).glob_metrics(glob, start_time, end_time) tracing.add_attr_to_trace("glob", str(glob)) - tracing.add_attr_to_trace("time.start", str(start_time)) - tracing.add_attr_to_trace("time.stop", str(end_time)) if glob == "": return [] @@ -637,8 +635,6 @@ def glob_directory_names(self, glob, start_time=None, end_time=None): glob, start_time, end_time ) tracing.add_attr_to_trace("glob", str(glob)) - tracing.add_attr_to_trace("time.start", str(start_time)) - tracing.add_attr_to_trace("time.stop", str(end_time)) if glob == "": return [] diff --git a/biggraphite/tracing.py b/biggraphite/tracing.py index bf6d4ad4ae..340d6d2f33 100644 --- a/biggraphite/tracing.py +++ b/biggraphite/tracing.py @@ -37,8 +37,8 @@ def trace(func): return func def tracer(self, *args, **kwargs): - _tracer = get_bg_trace(self, func) - with _tracer.span(name="%s.%s" % (self.module_name, func.__name__)): + tracer = get_bg_trace(self, func) + with tracer.span(name="%s.%s" % (self.module_name, func.__name__)): return func(self, *args, **kwargs) return tracer @@ -58,7 +58,7 @@ def add_attr_to_trace(key, value): """Add an attribute to the current span if tracing is enabled.""" if not execution_context: pass - _tracer = execution_context.get_opencensus_tracer() - _tracer.add_attribute_to_current_span( + tracer = execution_context.get_opencensus_tracer() + tracer.add_attribute_to_current_span( attribute_key=key, attribute_value=value)