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

fix(otelgorm): Make metric reporting work with prepared statements #129

Merged
merged 1 commit into from
Jun 13, 2024

Commits on Jun 11, 2024

  1. 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.
    magnusbaeck committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    d3f269a View commit details
    Browse the repository at this point in the history