|
39 | 39 |
|
40 | 40 | # Using elasticsearch as normal now will automatically generate spans |
41 | 41 | 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) |
44 | 44 |
|
45 | 45 | Elasticsearch instrumentation prefixes operation names with the string "Elasticsearch". This |
46 | 46 | 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): |
85 | 85 | # Using elasticsearch as normal now will automatically generate spans, |
86 | 86 | # including user custom attributes added from the hooks |
87 | 87 | 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) |
90 | 90 |
|
91 | 91 | API |
92 | 92 | --- |
|
0 commit comments