You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, I don't understand—is it a bug or a feature? I'm using this library for my app, and in my case, it's a bug.
I use OpenTelemetry's SQLAlchemyInstrumentor. To instrument SQLAlchemyInstrumentor, I need a SQLAlchemy engine. However, when I try to get the engine using GenericSQLAlchemyConfig.get_engine, it doesn't work correctly.
GenericSQLAlchemyConfig.get_engine is called twice: once during on_app_init and once when I try to get the engine. In this case, I need to provide my engine instance manually. Maybe we should store the created engine when using GenericSQLAlchemyConfig.get_engine?
I added some logs to create_async_engine
INFO: Started server process [22517]
INFO: Waiting for application startup.
Created new engine instance (id=135510527018560)
Created new engine instance (id=135510525573632)
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
Package Version
advanced_alchemy==0.30.3
sqlalchemy==2.0.38
Platform
Linux
Mac
Windows
Other (Please specify in the description above)
The text was updated successfully, but these errors were encountered:
Description
Actually, I don't understand—is it a bug or a feature? I'm using this library for my app, and in my case, it's a bug.
I use OpenTelemetry's SQLAlchemyInstrumentor. To instrument SQLAlchemyInstrumentor, I need a SQLAlchemy engine. However, when I try to get the engine using GenericSQLAlchemyConfig.get_engine, it doesn't work correctly.
GenericSQLAlchemyConfig.get_engine is called twice: once during on_app_init and once when I try to get the engine. In this case, I need to provide my engine instance manually. Maybe we should store the created engine when using GenericSQLAlchemyConfig.get_engine?
URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
No response
Logs
I added some logs to create_async_engine INFO: Started server process [22517] INFO: Waiting for application startup. Created new engine instance (id=135510527018560) Created new engine instance (id=135510525573632) INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
Package Version
advanced_alchemy==0.30.3
sqlalchemy==2.0.38
Platform
The text was updated successfully, but these errors were encountered: