-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instrumentation issues with coverage module and SQLite in latest 0.32b0 release #1179
Comments
This problem appears to be a regression in the import os
from opentelemetry.instrumentation.environment_variables import OTEL_PYTHON_DISABLED_INSTRUMENTATIONS
os.environ[OTEL_PYTHON_DISABLED_INSTRUMENTATIONS] = "sqlite3" Then the coverage module works correctly and no exception is raised. |
I have this same issue in Flask. sqlite3.ProgrammingError: Base Connection.init not called. When I remove the sqlite3 instrumentation I have no errors (or sql monitoring). In earlier versions this worked. |
@philipcwhite we had some ideas over in #1183 but nothing really conclusive, like which calls were no longer being propagated. You might have a better time reproducing the issue? |
Here is my test app. class Data: |
I am back on investigating this one |
@ocelotl Looks like I'm hitting this too. Does your fix solve it, and can it make it in to the next release? |
when using sqlite3 as a database in django, error message occur(django.db.utils.ProgrammingError: Base Connection.__init__ not called.) to solve this, setting environment value is working (OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=sqlite3) I referred site(open-telemetry/opentelemetry-python-contrib#1179 (comment))
Any news on this? Because that completely breaks the instrumentation with sqlite |
I still have this issue. Nothing seems to have been fixed. I posted in the CNCF slack on this. It looks like they may be working on something here but nothing has been released. #1183 |
According to #1179 (comment), this was a regression in the instrumentation. Has anyone experiencing the issue actually bisected this to find the root cause? |
@phillipuniverse please take a look at #1659, we are trying to revert the bugfix that introduced this issue. |
@ocelotl I saw you closed #1659 but FWIW it did resolve the issue. There are a few other examples of SQLAlchemy usage for test cases too:
It also seemed like we're about there with #1183, any reason to not accept that PR? |
@phillipuniverse sorry, I closed that PR to open a new one: #1660. Right now it is failing because an issue we have in AFAIK #1183 did not fix the issue completely and needs more investigation, I'd rather revert the original bugfix and start all over again. Sorry for the back and forth and for the long time it has taken to address this issue. |
Fully fixed in 0.37b0 by #1660. |
I utilize the automatic instrumentation for my projects during tests. When I run my tests with coverage I get an error in the last part when the coverage results are being written out:
An example execution for e.g. a Django project is this:
The only changes I have in my venv is the change from 1.12.0rc1 to 1.12.0rc2, and the contrib module from 0.31b0 to 0.32b0.
I can also reproduce this in some projects with Pytest, and the
pytest-cov
module:The way I kick off my instrumentation is to:
opentelemetry-contrib-instrumentations
dependency to pull in all instrumentationsSteps to reproduce
I'm working on a small example project that demonstrates the issue but wanted to get this open in the meantime to help others that might be googling for this issue. But basically:
This causes the test process to get an error code and tests "fail". If I don't instrument then I don't get an error and everything works fine.
Python version - 3.10.4 (reproducible in Python 3.7-3.10)
OpenTelemetry/contrib Version - 1.12.0rc2/0.32b0
Coverage - 6.3.3 or 6.4.1
pytest-cov - 3.0.0
The text was updated successfully, but these errors were encountered: