skillfed

opentelemetry-instrumentation-aiopg

OpenTelemetry aiopg instrumentation

opentelemetry-instrumentation-aiopg v0.65b0 3.3M downloads/30d#2,673 on PyPI1,086
Permissive license Apache-2.0 Active released

What it is and what it does

This package integrates OpenTelemetry tracing into aiopg, the async PostgreSQL driver for Python. When installed and initialized, it automatically wraps aiopg database calls to emit spans—structured records of database operations—that can be exported to observability platforms for monitoring, debugging, and performance analysis.

It sits between your application and aiopg, intercepting queries and connections to record timing, status, and query details. The instrumentation depends on opentelemetry-instrumentation-dbapi for shared database tracing logic and wrapt for non-invasive function wrapping. It is currently in beta (version 0.65b0) and requires Python 3.10 or later.

Use it for:

  • Monitor query latency and database operation timing in async web applications using aiopg.
  • Correlate database calls with HTTP requests and other services in distributed tracing systems.
  • Debug slow or failing database operations by examining detailed spans in a tracing backend.
  • Track database connection pool behavior and identify bottlenecks in async workloads.
  • Export database metrics to observability platforms like Jaeger or Datadog for centralized monitoring.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds distributed tracing instrumentation for aiopg, an async PostgreSQL driver, to automatically capture and export database operations as OpenTelemetry spans.

Yes, if you use aiopg in an async application and need distributed tracing. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it safe to adopt. The beta status is not a blocker—it reflects ongoing refinement, not instability. Install it if observability of your async database layer is a priority; skip it if you have no tracing infrastructure or do not use aiopg.

Install

opentelemetry-instrumentation-aiopg on PyPI

pip

pip install opentelemetry-instrumentation-aiopg

uv

uv add opentelemetry-instrumentation-aiopg

poetry

poetry add opentelemetry-instrumentation-aiopg

Installing opentelemetry-instrumentation-aiopg

Before you install

Low install friction with four runtime dependencies. Actively maintained as of 2026-08-14 with recent releases. Beta status (0.65b0) indicates the instrumentation is still stabilizing but usable.

License in practice

Apache-2.0 permissive license allows use in commercial and open-source projects with minimal restrictions beyond attribution.

Quickstart

pip install opentelemetry-instrumentation-aiopg

from opentelemetry.instrumentation.aiopg import AiopgInstrumentor
AiopgInstrumentor().instrument()

Requires Python 3.10 or later; aiopg must be installed and used in an async context; an OpenTelemetry exporter must be configured separately to send traces.

Verify before relying

  • Whether instrumentation works with all aiopg connection pool patterns or only direct connections.
  • Performance overhead of tracing in high-throughput async database workloads.
  • Compatibility with specific OpenTelemetry exporter backends (Jaeger, Datadog, etc.).

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — opentelemetry-api, opentelemetry-instrumentation-dbapi, opentelemetry-instrumentation, wrapt
Maintenance actively maintained — 29 days since the last release
Last repo commit
First released
Downloads 3,285,352/month — #2,673 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: opentelemetry_instrumentation_aiopg-0.65b0-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

opentelemetry aiopg instrumentationasync postgres tracingaiopg distributed tracingdatabase span instrumentationopentelemetry database monitoringaiopg observabilityasync database tracing
observabilityasync-postgresinstrumentation

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-asyncpg

Adds distributed tracing to PostgreSQL queries…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-mysql

Adds distributed tracing to MySQL database…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-aiokafka

Adds distributed tracing instrumentation to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-psycopg2

Adds distributed tracing instrumentation to…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation-aio-pika

Adds distributed tracing instrumentation to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-psycopg

Adds OpenTelemetry tracing instrumentation to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-sqlalchemy

Adds distributed tracing to SQLAlchemy database…

permissive · top 1,000 on PyPI

aiopg

aiopg provides asyncio-based access to…

permissive · top 15,000 on PyPI

opentelemetry-instrumentation-cassandra

Adds distributed tracing instrumentation to…

permissive · top 5,000 on PyPI

opentelemetry-instrumentation-redis

Adds distributed tracing to Redis client calls…

permissive · top 1,000 on PyPI