Register the collector
This commit is contained in:
parent
7c4e01e5c4
commit
685fecb033
|
@ -6,6 +6,7 @@ import (
|
|||
"regexp"
|
||||
|
||||
"github.com/matrix-org/dendrite/setup/config"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/collectors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
@ -48,6 +49,7 @@ func Open(dbProperties *config.DatabaseOptions, writer Writer) (*sql.DB, error)
|
|||
db.SetMaxIdleConns(dbProperties.MaxIdleConns())
|
||||
db.SetConnMaxLifetime(dbProperties.ConnMaxLifetime())
|
||||
}
|
||||
collectors.NewDBStatsCollector(db, fmt.Sprintf("dendrite_%s", dbProperties.Name))
|
||||
collector := collectors.NewDBStatsCollector(db, fmt.Sprintf("dendrite_%s", dbProperties.Name))
|
||||
prometheus.MustRegister(collector)
|
||||
return db, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue