asyncpg-opentracing

Opentracing instrumentation for asyncpg


Keywords
opentracing
License
MIT
Install
pip install asyncpg-opentracing==0.1.0

Documentation

OpenTracing Badge

Asyncpg Opentracing

This package provides opentracing supporting for applications using asyncpg library.

Insallation

$ pip install asyncpg_opentracing

Example of usage

To activate tracing of SQL commands:

  1. Wrap your connection class with tracing_connection:
from asyncpg.connection import Connection
from asyncpg_opentracing import tracing_connection

@tracing_connection
class MyConnection(Connection):
    pass
  1. Pass it as connection_class to the connect function:
await asyncpg.connect(user='user', password='password', database='database',
                      connection_class=MyConnection)

or to the create_pool function:

await asyncpg.create_pool(user='user', password='password', database='database',
                          connection_class=MyConnection)