Google Cloud SQLCommenter augments SQL statements with meta information about frameworks and the running environment, enabling better observability for database operations. It acts as a meta-package to install framework-specific SQLCommenter integrations (e.g., for SQLAlchemy, Django, Flask). The current version is 2.0.0, with new versions typically released to align with major dependency updates or new feature integrations.
pip install google-cloud-sqlcommenterVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to integrate SQLCommenter with SQLAlchemy. After installing `google-cloud-sqlcommenter`, import `patch` from `sqlalchemy_sqlcommenter` and apply it to your SQLAlchemy engine. All subsequent queries through that engine will be augmented with comments.
Upgrade your Python environment to 3.8 or newer. If you must use Python 3.6 or 3.7, pin your `google-cloud-sqlcommenter` dependency to a 1.x version (e.g., `google-cloud-sqlcommenter<2.0`).
Always import integration functions from the specific ORM integration package, such as `sqlalchemy_sqlcommenter` for SQLAlchemy, `django_sqlcommenter` for Django, etc. `google-cloud-sqlcommenter` is a meta-package.
Ensure `sqlalchemy_sqlcommenter.patch(engine)` is called immediately after creating your `sqlalchemy.engine` object and before any connections are made or queries executed through that engine. If using multiple engines, patch each one.
Refer to the official documentation on how SQLCommenter's OpenTelemetry integration interacts with your existing setup. Ensure your OpenTelemetry tracer provider and exporter are configured correctly to receive spans from SQLCommenter.
No dependency data recorded yet.