Skip to content

Commit

Permalink
fix: prepared statements enabled cause metrcis not work (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
zstone12 authored Oct 24, 2024
1 parent 5195d48 commit e290f95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ type gormRegister interface {

func (p otelPlugin) Initialize(db *gorm.DB) (err error) {
if !p.excludeMetrics {
if db, ok := db.ConnPool.(*sql.DB); ok {
metrics.ReportDBStatsMetrics(db)
if sqlDB, err := db.DB(); err == nil {
metrics.ReportDBStatsMetrics(sqlDB)
}
}

Expand Down

0 comments on commit e290f95

Please sign in to comment.