Skip to content

opentelemetry-contrib-sqlalchemy throws AttributeError: UNIX when instrumenting engines using UNIX sockets #2085

@ohaibbq

Description

@ohaibbq

Describe your environment
Hi! As of 0.42b, opentelemetry-contrib-sqlalchemy is throwing an attribute error when instrumenting engines that connect to a database using UNIX sockets.

This issue is fixed in main as part of test fixes when lint was added to CI in #2067 but I cannot find any formal filing for this issue.
Pinning to 0.41b fixes the issue as the semantic conventions library still contains this attribute.

When is 0.43b scheduled to be released?

Steps to reproduce

from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor
SQLAlchemyInstrumentor().instrument()

engine = create_engine("...connection string using unix sockets")
engine.execute("select * from table;")

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

What is the expected behavior?
Works without error

What is the actual behavior?

AttributeError: UNIX
at .__getattr__ ( /usr/lib/python3.9/enum.py:429 )
at ._get_attributes_from_cursor ( /app/.venv/lib/python3.9/site-packages/opentelemetry/instrumentation/sqlalchemy/engine.py:299 )
at ._before_cur_exec ( /app/.venv/lib/python3.9/site-packages/opentelemetry/instrumentation/sqlalchemy/engine.py:213 )
at ._execute_context ( /app/.venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1852 )
at ._execute_clauseelement ( /app/.venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1577 )
at ._execute_on_connection ( /app/.venv/lib/python3.9/site-packages/sqlalchemy/sql/elements.py:334 )
at ._execute_20 ( /app/.venv/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1710 )
at .execute ( /app/.venv/lib/python3.9/site-packages/sqlalchemy/orm/session.py:1717 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions