fix(telemetry): fix double instrumentation of database
This commit is contained in:
parent
c31c909c7b
commit
f031223150
5
db/db.go
5
db/db.go
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue