MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / GetMetricsDB

Method GetMetricsDB

pkg/management/postgres/instance.go:880–882  ·  view source on GitHub ↗

GetMetricsDB gets a connection to the named database authenticated as cnpg_metrics_exporter.

(dbname string)

Source from the content-addressed store, hash-verified

878
879// GetMetricsDB gets a connection to the named database authenticated as cnpg_metrics_exporter.
880func (instance *Instance) GetMetricsDB(dbname string) (*sql.DB, error) {
881 return instance.metricsConnectionPool().Connection(dbname)
882}
883
884// PostgreSQL SQLSTATE for "invalid authorization specification" (Class 28).
885// See https://www.postgresql.org/docs/current/errcodes-appendix.html

Callers 4

TryGetPgStatWALMethod · 0.95
updateInstanceMetricsMethod · 0.80

Calls 2

metricsConnectionPoolMethod · 0.95
ConnectionMethod · 0.65

Tested by

no test coverage detected