chore: only upload metrics on mysql (#4591)

This commit is contained in:
Kevin Wan 2025-01-22 20:26:24 +08:00 committed by GitHub
parent 1023800b02
commit 520d2a2075
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,6 +27,7 @@ func getCachedSqlConn(driverName, server string) (*sql.DB, error) {
return nil, err
}
if driverName != mysqlDriverName {
if cfg, e := mysql.ParseDSN(server); e != nil {
// if cannot parse, don't collect the metrics
logx.Error(e)
@ -41,6 +42,7 @@ func getCachedSqlConn(driverName, server string) (*sql.DB, error) {
},
})
}
}
return conn, nil
})