opentelemetry-instrumentation-mysqlclient
OpenTelemetry mysqlclient instrumentation
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Requires an active OpenTelemetry SDK and exporter configured in your application to actually export traces.
- Low install friction with a pure-Python wheel.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restriction.
last release 2026-07-16 (29 days) · last repo commit 2026-08-14 · 1,086 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,656,719 downloads/mo, #2,538 on PyPI
Alternatives
Verify before relying
pip install opentelemetry-instrumentation-mysqlclient
from opentelemetry.instrumentation.mysqlclient import MySQLClientInstrumentor
MySQLClientInstrumentor().instrument()- 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
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 on this page. Verify before relying on it.
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
opentelemetry-instrumentation-mysqlclient on PyPI
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.
Requires Python 3.10 or later. Requires an active OpenTelemetry SDK and exporter configured in your application to actually export traces.
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()
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 the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesopentelemetry-apiopentelemetry-instrumentation-dbapiopentelemetry-instrumentation |
| Maintenance | Actively maintained 29 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,656,719 / month, #2,538 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | 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 |
Evidence: opentelemetry_instrumentation_mysqlclient-0.65b0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “opentelemetry mysqlclient tracing”
- opentelemetry-instrumentation-mysqlclientAdds OpenTelemetry tracing instrumentation to mysqlclient database…
- opentelemetry-instrumentation-boto3sqsAdds distributed tracing to Boto3 SQS calls via OpenTelemetry,…
- opentelemetry-exporter-zipkin-jsonExports OpenTelemetry tracing data to Zipkin using JSON serialization…
Give your agent the search over MCP, or paste the wish link into any chat.
More Monitoring packages
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.
Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.
Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.
Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.
Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.
Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.
Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.
Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.
See also opentelemetry-instrumentation-dbapi · opentelemetry-instrumentation-mysql · opentelemetry-instrumentation-pymysql · opentelemetry-instrumentation-sqlite3 · opentelemetry-instrumentation-pymssql · opentelemetry-instrumentation-tortoiseorm · opentelemetry-instrumentation-psycopg · opentelemetry-instrumentation-psycopg2 · opentelemetry-instrumentation-sqlalchemy · mycli