Google Introduces Sqlcommenter

Sqlcommenter addresses the gap between the ORM libraries and understanding database performance. It gives you the ability to diagnose performance issues in your application code impacting databases.

Recently, Google introduced Sqlcommenter, which is an open-source library that addresses the gap between the ORM libraries and understanding database performance.

Sqlcommenter is an open-source ORM auto-instrumentation library that gives you visibility into which application code is generating slow queries and maps application traces to database query plans. It enables ORMs to augment SQL statements before execution, with comments containing information about the code that caused its execution. 

You need to do very little application code change to enable Sqlcommenter for your applications using ORMs. Observability information from Sqlcommenter can be utilized by application developers directly using slow query logs. You can also integrate it into other products or tools, such as Cloud SQL Insights, to provide application-centric monitoring.

The recently launched Cloud SQL Insights is also integrated with Sqlcommenter and helps you quickly understand and resolve your query performance issues on Cloud SQL. It gives self-service, intuitive monitoring, and diagnostic information that goes beyond detection to help you to discover the root cause of performance problems. 

Source: Google

You can trace the source of problematic queries across the application stack by model, view, controller, route, user, and host. 

To learn more you can visit the official announcement here.