collector

package
v0.12.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("collector returned no data")

ErrNoData indicates the collector found no data to collect, but had no other error.

Functions

func IsNoDataError

func IsNoDataError(err error) bool

Types

type Collector

type Collector interface {
	Update(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
}

func NewPGDatabaseCollector

func NewPGDatabaseCollector(logger log.Logger) (Collector, error)

func NewPGStatBGWriterCollector

func NewPGStatBGWriterCollector(logger log.Logger) (Collector, error)

type Option

type Option func(*PostgresCollector) error

type PGDatabaseCollector

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

func (PGDatabaseCollector) Update

func (PGDatabaseCollector) Update(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error

type PGStatBGWriterCollector

type PGStatBGWriterCollector struct {
}

func (PGStatBGWriterCollector) Update

func (PGStatBGWriterCollector) Update(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error

type PostgresCollector

type PostgresCollector struct {
	Collectors map[string]Collector
	// contains filtered or unexported fields
}

PostgresCollector implements the prometheus.Collector interface.

func NewPostgresCollector

func NewPostgresCollector(logger log.Logger, dsn string, filters []string, options ...Option) (*PostgresCollector, error)

NewPostgresCollector creates a new PostgresCollector.

func (PostgresCollector) Collect

func (p PostgresCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (PostgresCollector) Describe

func (p PostgresCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type ProbeCollector added in v0.12.0

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

func NewProbeCollector added in v0.12.0

func NewProbeCollector(logger log.Logger, registry *prometheus.Registry, dsn string) (*ProbeCollector, error)

func (*ProbeCollector) Collect added in v0.12.0

func (pc *ProbeCollector) Collect(ch chan<- prometheus.Metric)

func (*ProbeCollector) Describe added in v0.12.0

func (pc *ProbeCollector) Describe(ch chan<- *prometheus.Desc)

Jump to

Keyboard shortcuts

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