Skip to content

Commit b202843

Browse files
committed
chore: adding comment
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent be9d36e commit b202843

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/server.go

+5
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,11 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
740740
}()
741741

742742
if options.DeploymentValues.Prometheus.Enable {
743+
// At this stage we don't think the database name serves much purpose in these metrics.
744+
// It requires parsing the DSN to determine it, which requires pulling in another dependency
745+
// (i.e. https://github.com/jackc/pgx), but it's rather heavy.
746+
// The conn string (https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) can
747+
// take different forms, which make parsing non-trivial.
743748
options.PrometheusRegistry.MustRegister(collectors.NewDBStatsCollector(sqlDB, ""))
744749
}
745750

0 commit comments

Comments
 (0)