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

SQLAlchemy extension duplicate trace #1199

Open
czinegeandris opened this issue Apr 8, 2023 · 0 comments
Open

SQLAlchemy extension duplicate trace #1199

czinegeandris opened this issue Apr 8, 2023 · 0 comments
Labels

Comments

@czinegeandris
Copy link

czinegeandris commented Apr 8, 2023

Describe your environment. I am using a Python Azure Function where I use SQLAlchemy with async engine using postgres+asyncpg to make database queries based on the content of the request. I used the steps in their documentation to make it work, but and I added 'sqlalchemy' to trace_integrations instead of 'requests'.

from opencensus.extension.azure.functions import OpenCensusExtension
from opencensus.trace import config_integration

config_integration.trace_integrations(["sqlalchemy"])

OpenCensusExtension.configure()

Steps to reproduce.
Try integrating sqlalchemy in a Python Azure Function with asyncpg and an async engine of SQLAlchemy using async sessions.

What is the expected behavior?
I would like to see how long each query takes and some additional properties but I get them duplicated as seen below.

What is the actual behavior?
Strange thing is that one is the child of a span that already has a trace for that query.
image

Additional context.
I am not sure if this library is not prepared for async or it is because of sessions, connections, etc.
For illustration I made this with pg_sleep, but it is the same with "normal" queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant