From 16726183f2985d89fe17a81d512d64d72dd88811 Mon Sep 17 00:00:00 2001 From: Angela Li Date: Mon, 27 Nov 2017 13:53:58 -0800 Subject: [PATCH] Remove sql query from span name --- trace/opencensus/trace/ext/dbapi/trace.py | 2 +- trace/opencensus/trace/ext/postgresql/trace.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trace/opencensus/trace/ext/dbapi/trace.py b/trace/opencensus/trace/ext/dbapi/trace.py index e88c00c13..3fa9fe9eb 100644 --- a/trace/opencensus/trace/ext/dbapi/trace.py +++ b/trace/opencensus/trace/ext/dbapi/trace.py @@ -54,7 +54,7 @@ def trace_cursor_query(query_func): def call(query, *args, **kwargs): _tracer = execution_context.get_opencensus_tracer() _span = _tracer.start_span() - _span.name = '[mysql.query]{}'.format(query) + _span.name = 'mysql.query' _tracer.add_label_to_current_span('mysql/query', query) _tracer.add_label_to_current_span( 'mysql/cursor/method/name', diff --git a/trace/opencensus/trace/ext/postgresql/trace.py b/trace/opencensus/trace/ext/postgresql/trace.py index 7ba21c55c..10d9bd275 100644 --- a/trace/opencensus/trace/ext/postgresql/trace.py +++ b/trace/opencensus/trace/ext/postgresql/trace.py @@ -49,7 +49,7 @@ def trace_cursor_query(query_func): def call(query, *args, **kwargs): _tracer = execution_context.get_opencensus_tracer() _span = _tracer.start_span() - _span.name = '[{}.query]{}'.format(MODULE_NAME, query) + _span.name = '{}.query'.format(MODULE_NAME) _tracer.add_label_to_current_span( '{}/query'.format(MODULE_NAME), query) _tracer.add_label_to_current_span(