This commit is contained in:
Srikanth Chekuri
2020-11-17 18:15:45 +05:30
parent d09c0ed597
commit 1fa94fc1cf

View File

@ -85,8 +85,7 @@ class ElasticsearchInstrumentor(BaseInstrumentor):
def __init__(self, span_name_prefix=None):
if not span_name_prefix:
span_name_prefix = environ.get(
"OTEL_PYTHON_ELASTICSEARCH_NAME_PREFIX",
"Elasticsearch",
"OTEL_PYTHON_ELASTICSEARCH_NAME_PREFIX", "Elasticsearch",
)
self._span_name_prefix = span_name_prefix.strip()
super().__init__()
@ -125,8 +124,7 @@ def _wrap_perform_request(tracer, span_name_prefix):
body = kwargs.get("body", None)
with tracer.start_as_current_span(
op_name,
kind=SpanKind.CLIENT,
op_name, kind=SpanKind.CLIENT,
) as span:
if span.is_recording():
attributes = {