Skip to content

Commit a363244

Browse files
committed
fix: add a dependency for mysql
1 parent 10c47ea commit a363244

4 files changed

Lines changed: 41 additions & 6 deletions

File tree

docs/usage.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Or install only what you need:
2121
| `django-o11y[celery]` | Celery tracing and structured task logs |
2222
| `django-o11y[profiling]` | Pyroscope continuous profiling |
2323
| `django-o11y[postgres]` | OpenTelemetry traces for psycopg2 / psycopg (v3) queries |
24+
| `django-o11y[sqlite]` | OpenTelemetry traces for SQLite queries |
25+
| `django-o11y[mysql]` | OpenTelemetry traces for MySQL queries via PyMySQL |
2426
| `django-o11y[redis]` | OpenTelemetry traces for Redis/cache operations |
2527
| `django-o11y[http]` | OpenTelemetry traces for outbound `requests`, `urllib3`, `urllib`, and `httpx` calls |
2628
| `django-o11y[aws]` | OpenTelemetry traces for AWS SDK calls via boto3/botocore (enable via `TRACING.AWS_ENABLED`) |
@@ -463,8 +465,8 @@ Instrumentation activates automatically when the relevant package is installed.
463465
| Django HTTP requests | One span per view — method, route, status code, user ID | Always active |
464466
| PostgreSQL (psycopg2) | One span per query with SQL commenter | `django-o11y[postgres]` |
465467
| PostgreSQL (psycopg v3) | One span per query with SQL commenter | `django-o11y[postgres]` |
466-
| MySQL (PyMySQL) | One span per query | Install [PyMySQL](https://pypi.org/project/PyMySQL/) directly |
467-
| SQLite | One span per query | Install [sqlite3](https://docs.python.org/3/library/sqlite3.html) (stdlib) |
468+
| MySQL (PyMySQL) | One span per query | `django-o11y[mysql]` |
469+
| SQLite | One span per query | `django-o11y[sqlite]` |
468470
| Redis / cache | One span per cache operation | `django-o11y[redis]` |
469471
| Celery tasks | One span per task, linked to the originating request via [W3C TraceContext](https://www.w3.org/TR/trace-context/) propagation | `django-o11y[celery]` |
470472
| Outbound HTTP ([requests](https://requests.readthedocs.io/)) | One span per call | `django-o11y[http]` |

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ postgres = [
7272
# SQLite instrumentation
7373
sqlite = ["opentelemetry-instrumentation-sqlite3>=0.60b1"]
7474

75+
# MySQL instrumentation
76+
mysql = ["pymysql>=1.1.0", "opentelemetry-instrumentation-pymysql>=0.60b1"]
77+
7578
# Cache instrumentation
7679
redis = [
7780
"redis>=7.2.0",
@@ -98,7 +101,7 @@ dev-logging = ["rich>=14.3.3"]
98101

99102
# All features
100103
all = [
101-
"django-o11y[celery,profiling,postgres,sqlite,redis,http,aws,channels,dev-logging]",
104+
"django-o11y[celery,profiling,postgres,sqlite,mysql,redis,http,aws,channels,dev-logging]",
102105
]
103106

104107
# Documentation

src/django_o11y/management/commands/o11y.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ def _write_celery_exporter_override(work_dir: Path, broker_url: str) -> None:
319319
- CE_BUCKETS=1,2.5,5,10,30,60,300,600,900,1800
320320
ports:
321321
- "{CELERY_EXPORTER_PORT}:{CELERY_EXPORTER_PORT}"
322-
restart: unless-stopped
323322
extra_hosts:
324323
- "host.docker.internal:host-gateway"
325324
"""

uv.lock

Lines changed: 33 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)