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