opentelemetry.ext.asyncpg package

Module contents

This library allows tracing PostgreSQL queries made by the asyncpg library.

Usage

import asyncpg
from opentelemetry.ext.asyncpg import AsyncPGInstrumentor

# You can optionally pass a custom TracerProvider to AsyncPGInstrumentor.instrument()
AsyncPGInstrumentor().instrument()
conn = await asyncpg.connect(user='user', password='password',
                             database='database', host='127.0.0.1')
values = await conn.fetch('''SELECT 42;''')

API

class opentelemetry.ext.asyncpg.AsyncPGInstrumentor(capture_parameters=False)[source]

Bases: opentelemetry.instrumentation.instrumentor.BaseInstrumentor