Skip to content

auto-instrumentation pymysql not working in newer release #2259

@philipcwhite

Description

@philipcwhite

Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.

With new versions of OpenTelemetry for python I lose pymysql monitoring. It was working fine with 0.21b0 and Flask 1. With newer releases it fails on both Flask1 and Flask 2. I'm not sure which release broke this but my last known working configuration is 0.21b0.

Launching app with
OTEL_EXPORTER_OTLP_ENDPOINT="localhost:4317" OTEL_RESOURCE_ATTRIBUTES="service.name=demo-flask" opentelemetry-instrument flask run

Env:
Python 3.8
Flask 1 or 2
MySQL
Ubuntu Linux 20.04

Steps to reproduce
Describe exactly how to reproduce the error. Include a code sample if applicable.

Old Requirements file is working.
Flask==1.1.2
Jinja2==2.11.2
opentelemetry-api==1.2.0
opentelemetry-exporter-jaeger-thrift==1.2.0
opentelemetry-exporter-otlp-proto-grpc==1.2.0
opentelemetry-instrumentation==0.21b0
opentelemetry-instrumentation-dbapi==0.21b0
opentelemetry-instrumentation-flask==0.21b0
opentelemetry-instrumentation-grpc==0.21b0
opentelemetry-instrumentation-jinja2==0.21b0
opentelemetry-instrumentation-pymysql==0.21b0
opentelemetry-instrumentation-requests==0.21b0
opentelemetry-instrumentation-urllib==0.21b0
opentelemetry-instrumentation-wsgi==0.21b0
opentelemetry-propagator-b3==1.2.0
opentelemetry-proto==1.2.0
opentelemetry-sdk==1.2.0
opentelemetry-semantic-conventions==0.21b0
opentelemetry-util-http==0.21b0
opentelemetry-distro==0.21b0
PyMySQL==0.10.1
requests==2.25.1

New Requirements Fails
Flask==1.1.2
Jinja2==2.11.2
opentelemetry-api
opentelemetry-exporter-jaeger-thrift
opentelemetry-exporter-otlp-proto-grpc
opentelemetry-instrumentation
opentelemetry-instrumentation-dbapi
opentelemetry-instrumentation-flask
opentelemetry-instrumentation-grpc
opentelemetry-instrumentation-jinja2
opentelemetry-instrumentation-pymysql
opentelemetry-instrumentation-requests
opentelemetry-instrumentation-urllib
opentelemetry-instrumentation-wsgi
opentelemetry-propagator-b3
opentelemetry-proto
opentelemetry-sdk
opentelemetry-semantic-conventions
opentelemetry-util-http
opentelemetry-distro
PyMySQL==0.10.1
requests==2.25.1

What is the expected behavior?
What did you expect to see?
There are db traces with the old configuration but they no longer show up with the new configuration

What is the actual behavior?
What did you see instead?
database traces do not show up

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions