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] instrumenting multiple sqlalchemy engines #1103

Closed
sungwonh opened this issue May 24, 2022 · 0 comments · Fixed by #1132
Closed

[sqlalchemy] instrumenting multiple sqlalchemy engines #1103

sungwonh opened this issue May 24, 2022 · 0 comments · Fixed by #1132
Labels
bug Something isn't working instrumentation

Comments

@sungwonh
Copy link
Contributor

sungwonh commented May 24, 2022

I have two sqlalchemy engines. One for write operations and one for read only operations.

I am wonder how to instrument two sqlalchemy engines at the same time.

When I called SQLAlchemyInstrumentor().instrument() method for each engine as shown below, spans for the second called engine are not created.

write_engine = create_async_engine("postgresql://write-endpoint")
read_engine = create_async_engine("postgresql://read-endpoint")

SQLAlchemyInstrumentor().instrument(engine=write_engine.sync_engine)
SQLAlchemyInstrumentor().instrument(engine=read_engine.sync_engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working instrumentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants