fix(telemetry): fix double instrumentation of database

This commit is contained in:
Tigor Hutasuhut 2024-04-13 00:34:56 +07:00
parent c31c909c7b
commit f031223150

View file

@ -26,11 +26,6 @@ func Open(cfg *config.Config) (*sql.DB, error) {
return db, errs.Wrapw(err, "failed to open database", "driver", driver) return db, errs.Wrapw(err, "failed to open database", "driver", driver)
} }
err = otelsql.RegisterDBStatsMetrics(db, otelsql.WithAttributes(semconv.DBSystemSqlite))
if err != nil {
return db, errs.Wrapw(err, "failed to instrument database with otel")
}
if cfg.Bool("db.automigrate") { if cfg.Bool("db.automigrate") {
goose.SetLogger(&gooseLogger{}) goose.SetLogger(&gooseLogger{})
goose.SetBaseFS(Migrations) goose.SetBaseFS(Migrations)