Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(otelgorm): Make metric reporting work with prepared statements
Previously we only initialized metrics reporting by calling otelsql.ReportDBStatsMetrics if the gorm.DB.ConnPool interface pointer we received happened to be a *sql.DB. This was often the case, but not if prepared statements were enabled (and possibly in other circumstances too). This caused metrics reporting to be silently disabled. We fix this by calling gorm.DB.DB whose sole purpose is to extract the underlying *sql.DB.
- Loading branch information