Skip to content

Commit 5cde922

Browse files
author
Emanuele Palazzetti
authored
Merge pull request #308 from benjamin/fix-es-doc
Use from elasticsearch import ... syntax in doc
2 parents 3abc5e3 + aa1d19a commit 5cde922

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ddtrace/contrib/elasticsearch/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
::
55
66
from ddtrace import Pin, patch
7-
import elasticsearch
7+
from elasticsearch import Elasticsearch
88
99
# If not patched yet, you can patch elasticsearch specifically
1010
patch(elasticsearch=True)
1111
1212
# This will report spans with the default instrumentation
13-
es = elasticsearch.Elasticsearch(port=ELASTICSEARCH_CONFIG['port'])
13+
es = Elasticsearch(port=ELASTICSEARCH_CONFIG['port'])
1414
# Example of instrumented query
1515
es.indices.create(index='books', ignore=400)
1616
1717
# Use a pin to specify metadata related to this client
18-
es = elasticsearch.Elasticsearch(port=ELASTICSEARCH_CONFIG['port'])
18+
es = Elasticsearch(port=ELASTICSEARCH_CONFIG['port'])
1919
Pin.override(es.transport, service='elasticsearch-videos')
2020
es.indices.create(index='videos', ignore=400)
2121
"""

0 commit comments

Comments
 (0)