The trace integration with Database API supports libraries that follow the Python Database API Specification v2.0. https://www.python.org/dev/peps/pep-0249/
Usageimport mysql.connector import pyodbc from opentelemetry.instrumentation.dbapi import trace_integration # Ex: mysql.connector trace_integration(mysql.connector, "connect", "mysql") # Ex: pyodbc trace_integration(pyodbc, "Connection", "odbc")API
Integrate with DB API library. https://www.python.org/dev/peps/pep-0249/
connect_module (Callable
[...
, Any
]) – Module name where connect method is available.
connect_method_name (str
) – The connect method name.
database_system (str
) – An identifier for the database management system (DBMS) product being used.
connection_attributes (Optional
[dict
[str
, Any
]]) – Attribute names for database, port, host and user in Connection object.
tracer_provider (Optional
[TracerProvider
]) – The opentelemetry.trace.TracerProvider
to use. If omitted the current configured one is used.
capture_parameters (bool
) – Configure if db.statement.parameters should be captured.
enable_commenter (bool
) – Flag to enable/disable sqlcommenter.
db_api_integration_factory (Optional
[type
[DatabaseApiIntegration
]]) – The DatabaseApiIntegration to use. If none is passed the default one is used.
enable_attribute_commenter (bool
) – Flag to enable/disable sqlcomment inclusion in db.statement span attribute. Only available if enable_commenter=True.
Integrate with DB API library. https://www.python.org/dev/peps/pep-0249/
connect_module (Callable
[...
, Any
]) – Module name where connect method is available.
connect_method_name (str
) – The connect method name.
database_system (str
) – An identifier for the database management system (DBMS) product being used.
connection_attributes (Optional
[dict
[str
, Any
]]) – Attribute names for database, port, host and user in Connection object.
tracer_provider (Optional
[TracerProvider
]) – The opentelemetry.trace.TracerProvider
to use. If omitted the current configured one is used.
capture_parameters (bool
) – Configure if db.statement.parameters should be captured.
enable_commenter (bool
) – Flag to enable/disable sqlcommenter.
db_api_integration_factory (Optional
[type
[DatabaseApiIntegration
]]) – The DatabaseApiIntegration to use. If none is passed the default one is used.
commenter_options (Optional
[dict
[str
, Any
]]) – Configurations for tags to be appended at the sql query.
enable_attribute_commenter (bool
) – Flag to enable/disable sqlcomment inclusion in db.statement span attribute. Only available if enable_commenter=True.
Disable integration with DB API library. https://www.python.org/dev/peps/pep-0249/
Enable instrumentation in a database connection.
name (str
) – The instrumentation module name.
connection (Union
[TypeVar
(ConnectionT
), TracedConnectionProxy
[TypeVar
(ConnectionT
)]]) – The connection to instrument.
database_system (str
) – An identifier for the database management system (DBMS) product being used.
connection_attributes (Optional
[dict
[str
, Any
]]) – Attribute names for database, port, host and user in a connection object.
tracer_provider (Optional
[TracerProvider
]) – The opentelemetry.trace.TracerProvider
to use. If omitted the current configured one is used.
capture_parameters (bool
) – Configure if db.statement.parameters should be captured.
enable_commenter (bool
) – Flag to enable/disable sqlcommenter.
commenter_options (Optional
[dict
[str
, Any
]]) – Configurations for tags to be appended at the sql query.
connect_module (Optional
[Callable
[...
, Any
]]) – Module name where connect method is available.
enable_attribute_commenter (bool
) – Flag to enable/disable sqlcomment inclusion in db.statement span attribute. Only available if enable_commenter=True.
db_api_integration_factory (Optional
[type
[DatabaseApiIntegration
]]) – A class or factory function to use as a replacement for DatabaseApiIntegration
. Can be used to obtain connection attributes from the connect method instead of from the connection itself (as done by the pymssql intrumentor).
TracedConnectionProxy
[TypeVar
(ConnectionT
)]
An instrumented connection.
Disable instrumentation in a database connection.
connection (Union
[TypeVar
(ConnectionT
), TracedConnectionProxy
[TypeVar
(ConnectionT
)]]) – The connection to uninstrument.
TypeVar
(ConnectionT
)
An uninstrumented connection.
Bases: object
Add object proxy to connection object.
TracedConnectionProxy
[TypeVar
(ConnectionT
)]
Bases: ObjectProxy
, Generic
[ConnectionT
]
TracedConnectionProxy
[TypeVar
(ConnectionT
)]
Bases: Generic
[CursorT
]
Bases: ObjectProxy
, Generic
[CursorT
]
TracedCursorProxy
[TypeVar
(CursorT
)]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4