Skip to content

Commit

Permalink
Add example for pyodbc (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
lizthegrey committed Mar 12, 2020
1 parent dd8521e commit 52332ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ext/opentelemetry-ext-dbapi/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ Usage
.. code-block:: python
import mysql.connector
import pyodbc
from opentelemetry.trace import tracer_provider
from opentelemetry.ext.dbapi import trace_integration
trace.set_preferred_tracer_provider_implementation(lambda T: TracerProvider())
tracer = trace.get_tracer(__name__)
# Ex: mysql.connector
trace_integration(tracer_provider(), mysql.connector, "connect", "mysql")
trace_integration(tracer_provider(), mysql.connector, "connect", "mysql", "sql")
# Ex: pyodbc
trace_integration(tracer_provider(), pyodbc, "Connection", "odbc", "sql")
References
Expand Down

0 comments on commit 52332ce

Please sign in to comment.