metrics

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBMetricsCollector

type DBMetricsCollector struct {
	// contains filtered or unexported fields
}

DBMetricsCollector ...

func NewDBMetricsCollector

func NewDBMetricsCollector(namespace, subsystem string, db DBStatsGetter) *DBMetricsCollector

NewDBMetricsCollector return all the metrics

func (*DBMetricsCollector) Collect

func (c *DBMetricsCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface

func (*DBMetricsCollector) Describe

func (c *DBMetricsCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface

type DBStatsGetter

type DBStatsGetter interface {
	Stats() sql.DBStats
}

DBStatsGetter is an interface that gets sql.DBStats. It's implemented by e.g. *sql.DB or *sqlx.DB.

type Metrics

type Metrics struct {

	// Global
	Up   prometheus.Gauge
	Info prometheus.Gauge

	// Consumers
	ConsumerRunning  *prometheus.GaugeVec
	ConsumerMessages *prometheus.CounterVec

	// Storage Workers
	StorageWorkerRunning            *prometheus.GaugeVec
	StorageWorkerMessages           *prometheus.CounterVec
	StorageWorkerProcessingDuration *prometheus.HistogramVec

	// Storer
	RepositoryMessagesTotal              prometheus.Counter
	RepositoryMessagesErrorsTotal        prometheus.Counter
	RepositorySQLMessagesTotal           prometheus.Counter
	RepositorySQLMessagesErrorsTotal     prometheus.Counter
	RepositorySQLMessagesToDBTotal       prometheus.Counter
	RepositorySQLMessagesToDBErrorsTotal prometheus.Counter
	RepositoryMessagesAckTotal           prometheus.Counter
	RepositoryMessagesRejectedTotal      prometheus.Counter

	// Storage
	StoragePingTotal        prometheus.Counter
	StoragePingTimeOutTotal prometheus.Counter
	StorageExecTotal        prometheus.Counter
	StorageExecTimeOutTotal prometheus.Counter
	// contains filtered or unexported fields
}

Metrics ...

func New

func New(c *config.Config) *Metrics

New return all the metrics

func (Metrics) EnableDBStats

func (m Metrics) EnableDBStats(db storage.Store)

EnableDBStats enable the database/sql stats metrics

func (Metrics) GetHandler

func (m Metrics) GetHandler() http.Handler

GetHandler return the http handler for metrics endpoints

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL