Documentation ¶
Overview ¶
Package metricsserver contains the web server powering metrics
Package metricsserver enables to expose a set of metrics and collectors on a given postgres instance
Index ¶
Constants ¶
const PrometheusNamespace = "cnpg"
PrometheusNamespace is the namespace to be used for all custom metrics exposed by instances or the operator
Variables ¶
This section is empty.
Functions ¶
func ListenAndServe ¶
func ListenAndServe() error
ListenAndServe starts the web server handling metrics
Types ¶
type Exporter ¶
type Exporter struct { Metrics *metrics // contains filtered or unexported fields }
Exporter exports a set of metrics and collectors on a given postgres instance
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector, collecting the Metrics values to export.
func (*Exporter) ConnectionPool ¶
func (e *Exporter) ConnectionPool() *pool.ConnectionPool
ConnectionPool gets or initializes the connection pool for this instance
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector, defining the Metrics we return.
type ShowListsMetrics ¶
type ShowListsMetrics map[string]prometheus.Gauge
ShowListsMetrics contains all the SHOW LISTS Metrics
func NewShowListsMetrics ¶
func NewShowListsMetrics(subsystem string) ShowListsMetrics
NewShowListsMetrics builds the default ShowListsMetrics
func (ShowListsMetrics) Describe ¶
func (s ShowListsMetrics) Describe(ch chan<- *prometheus.Desc)
Describe produces the description for all the contained Metrics
func (ShowListsMetrics) Reset ¶
func (s ShowListsMetrics) Reset()
Reset resets all the contained Metrics
type ShowPoolsMetrics ¶
type ShowPoolsMetrics struct { ClActive, ClWaiting, ClCancelReq, SvActive, SvIdle, SvUsed, SvTested, SvLogin, MaxWait, MaxWaitUs, PoolMode *prometheus.GaugeVec }
ShowPoolsMetrics contains all the SHOW POOLS Metrics
func NewShowPoolsMetrics ¶
func NewShowPoolsMetrics(subsystem string) *ShowPoolsMetrics
NewShowPoolsMetrics builds the default ShowPoolsMetrics
func (*ShowPoolsMetrics) Describe ¶
func (r *ShowPoolsMetrics) Describe(ch chan<- *prometheus.Desc)
Describe produces the description for all the contained Metrics
func (*ShowPoolsMetrics) Reset ¶
func (r *ShowPoolsMetrics) Reset()
Reset resets all the contained Metrics
type ShowStatsMetrics ¶
type ShowStatsMetrics struct { TotalXactCount, TotalQueryCount, TotalReceived, TotalSent, TotalXactTime, TotalQueryTime, TotalWaitTime, AvgXactCount, AvgQueryCount, AvgRecv, AvgSent, AvgXactTime, AvgQueryTime, AvgWaitTime *prometheus.GaugeVec }
ShowStatsMetrics contains all the SHOW STATS Metrics
func NewShowStatsMetrics ¶
func NewShowStatsMetrics(subsystem string) *ShowStatsMetrics
NewShowStatsMetrics builds the default ShowStatsMetrics
func (*ShowStatsMetrics) Describe ¶
func (r *ShowStatsMetrics) Describe(ch chan<- *prometheus.Desc)
Describe produces the description for all the contained Metrics
func (*ShowStatsMetrics) Reset ¶
func (r *ShowStatsMetrics) Reset()
Reset resets all the contained Metrics