Skip to content

Commit 3ad4782

Browse files
committed
Fix doc_type for elasticsearch instrumentation examples
1 parent 1799d87 commit 3ad4782

File tree

1 file changed

+4
-4
lines changed
  • instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch

1 file changed

+4
-4
lines changed

instrumentation/opentelemetry-instrumentation-elasticsearch/src/opentelemetry/instrumentation/elasticsearch/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
4040
# Using elasticsearch as normal now will automatically generate spans
4141
es = elasticsearch.Elasticsearch()
42-
es.index(index='my-index', doc_type='my-type', id=1, body={'my': 'data', 'timestamp': datetime.now()})
43-
es.get(index='my-index', doc_type='my-type', id=1)
42+
es.index(index='my-index', doc_type='_doc', id=1, body={'my': 'data', 'timestamp': datetime.now()})
43+
es.get(index='my-index', doc_type='_doc', id=1)
4444
4545
Elasticsearch instrumentation prefixes operation names with the string "Elasticsearch". This
4646
can be changed to a different string by either setting the OTEL_PYTHON_ELASTICSEARCH_NAME_PREFIX
@@ -85,8 +85,8 @@ def response_hook(span, response):
8585
# Using elasticsearch as normal now will automatically generate spans,
8686
# including user custom attributes added from the hooks
8787
es = elasticsearch.Elasticsearch()
88-
es.index(index='my-index', doc_type='my-type', id=1, body={'my': 'data', 'timestamp': datetime.now()})
89-
es.get(index='my-index', doc_type='my-type', id=1)
88+
es.index(index='my-index', doc_type='_doc', id=1, body={'my': 'data', 'timestamp': datetime.now()})
89+
es.get(index='my-index', doc_type='_doc', id=1)
9090
9191
API
9292
---

0 commit comments

Comments
 (0)