--- id: opentelemetry-instrumentation-mysqlclient version: "0.65b0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # opentelemetry-instrumentation-mysqlclient — OpenTelemetry mysqlclient instrumentation License: permissive · Maintenance: active · Downloads: 3.7M/mo ## What it is and what it does This package integrates OpenTelemetry tracing into mysqlclient, the pure-Python MySQL client library. When installed and initialized, it automatically wraps database connections to emit span data for each SQL query executed, including timing, query text, and connection details. This allows you to see database activity in your distributed tracing system without modifying application code that uses mysqlclient. The instrumentation builds on OpenTelemetry's dbapi instrumentation layer, which provides a standardized approach to database tracing. It requires Python 3.10 or later and depends on opentelemetry-api, opentelemetry-instrumentation, and opentelemetry-instrumentation-dbapi. The package is in beta status (0.65b0) but actively maintained, with recent releases and no known security vulnerabilities. Use it for: - Trace database queries in a distributed system to identify slow or problematic SQL execution - Monitor MySQL connection pool usage and query latency across microservices - Correlate database activity with application logs and metrics in a centralized observability platform - Debug performance issues by seeing which queries run during a specific request or transaction - Collect database metrics for SLO monitoring and alerting on query performance ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds OpenTelemetry tracing instrumentation to mysqlclient database connections, automatically capturing SQL queries and performance metrics. Yes, if you are already using OpenTelemetry in your application and need visibility into mysqlclient database calls. The low install friction, active maintenance, permissive license, and zero known vulnerabilities make it a straightforward addition to an observability stack. Not necessary if you don't use OpenTelemetry or don't need database-level tracing. ## Install pip install opentelemetry-instrumentation-mysqlclient uv add opentelemetry-instrumentation-mysqlclient poetry add opentelemetry-instrumentation-mysqlclient ## Installing opentelemetry-instrumentation-mysqlclient Before you install: Low install friction with a pure-Python wheel. Actively maintained as of 2026-08-14 with recent releases. Depends on three OpenTelemetry core packages (opentelemetry-api, opentelemetry-instrumentation, opentelemetry-instrumentation-dbapi), all part of the same ecosystem. License in practice: Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restriction. Quickstart: pip install opentelemetry-instrumentation-mysqlclient from opentelemetry.instrumentation.mysqlclient import MySQLClientInstrumentor MySQLClientInstrumentor().instrument() Requires Python 3.10 or later. Requires an active OpenTelemetry SDK and exporter configured in your application to actually export traces. Verify before relying: - Whether this instrumentation works with all mysqlclient versions or has specific version constraints - Performance overhead of instrumentation in production workloads - Whether automatic instrumentation captures query parameters or only query structure ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags opentelemetry mysqlclient tracing, mysql instrumentation observability, database query tracing, mysql performance monitoring, opentelemetry dbapi instrumentation, sql query observability, mysql connection tracing, observability, distributed-tracing, database-instrumentation [View on SkillFed](https://skillfed.io/packages/opentelemetry-instrumentation-mysqlclient) · [View on PyPI](https://pypi.org/project/opentelemetry-instrumentation-mysqlclient/)