Skip to content
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

Several instrumentation failures with TypeError (urllib, flask, sqlite3, logging) on dev version #4378

Closed
tammy-baylis-swi opened this issue Jan 3, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@tammy-baylis-swi
Copy link
Contributor

tammy-baylis-swi commented Jan 3, 2025

Describe your environment

OS: Ubuntu
Python version: 3.12.8
SDK version: 1.30.0dev
API version: 0.51b0dev

What happened?

opentelemetry-bootstrap and opentelemetry-instrument using Otel's opentelemetry-distro at main branch (1.30.0dev/0.51b0dev) fail with an error stack at loading of the urllib/Flask/sqlite3/logging instrumentor at app startup. urllib, sqlite3, and logging are some of the default_instrumentations:

Instrumenting of urllib failed
Traceback (most recent call last):
  File "/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 104, in _load_instrumentors
    conflict = get_dist_dependency_conflicts(entry_point_dist)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/dependencies.py", line 50, in get_dist_dependency_conflicts
    for dep in dist.requires:
               ^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
Failed to auto initialize opentelemetry
Traceback (most recent call last):
  File "/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py", line 39, in initialize
    _load_instrumentors(distro)
  File "/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 129, in _load_instrumentors
    raise exc
  File "/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py", line 104, in _load_instrumentors
    conflict = get_dist_dependency_conflicts(entry_point_dist)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/dependencies.py", line 50, in get_dist_dependency_conflicts
    for dep in dist.requires:
               ^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

EDIT: This also happens with the instrumentors for Flask, sqlite3, and logging. The TypeError eventually stops if I set OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=flask,logging,sqlite3,urllib

This doesn't happen with latest release 1.29.0/0.50b0, but something else odd happens and I'm not sure if related. Spans from opentelemetry-instrumentation-flask end up being kind Internal instead of Server. Either way, error stacks not good.

Steps to Reproduce

I'm using main branches of the SDK and API (1.30.0dev/0.51b0dev) to auto-instrument a basic Flask app:

pip install opentelemetry-distro opentelemetry-exporter-otlp
opentelemetry-bootstrap -a install
opentelemetry-instrument flask run

with app.py as:

from flask import Flask

app = Flask(__name__)

@app.route("/abc/")
def request_abc():
    return "Done"

Expected Result

No error traces

Actual Result

Error trace as above

Additional context

No response

Would you like to implement a fix?

None

@tammy-baylis-swi tammy-baylis-swi added the bug Something isn't working label Jan 3, 2025
@tammy-baylis-swi tammy-baylis-swi changed the title urllib instrumentation failure with TypeError Several instrumentation failures with TypeError (urllib, flask, sqlite3, logging) Jan 3, 2025
@tammy-baylis-swi tammy-baylis-swi changed the title Several instrumentation failures with TypeError (urllib, flask, sqlite3, logging) Several instrumentation failures with TypeError (urllib, flask, sqlite3, logging) on dev version Jan 3, 2025
@tammy-baylis-swi
Copy link
Contributor Author

Sorry this should have been a contrib issue. Closing this in favour of open-telemetry/opentelemetry-python-contrib#3167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant