collector

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter added in v0.3.0

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

func NewExporter added in v0.3.0

func NewExporter(ctx context.Context, logger kitlog.Logger, connConfig *pgx.ConnConfig) *Exporter

NewExporter is called every time we receive a scrape request and knows how to collect metrics using each of the scrapers. It will live only for the duration of the scrape request.

func (Exporter) Collect added in v0.3.0

func (e Exporter) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (Exporter) Describe added in v0.3.0

func (e Exporter) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type Scraper added in v0.3.0

type Scraper interface {
	Name() string
	// Scrape new metrics and expose them via prometheus registry.
	Scrape(ctx context.Context, db *pgx.Conn, version Version, ch chan<- prometheus.Metric) error
}

Scraper is the interface each scraper has to implement.

func NewDiskUsageScraper added in v0.9.0

func NewDiskUsageScraper() Scraper

NewDiskUsageScraper returns a new Scraper exposing postgres disk usage view

func NewInfoScraper added in v0.3.0

func NewInfoScraper() Scraper

NewInfoScraper returns a new Scraper exposing postgres info

func NewLocksScraper added in v0.3.0

func NewLocksScraper() Scraper

NewLocksScraper returns a new Scraper exposing data from pg_locks

func NewStatActivityScraper added in v0.3.0

func NewStatActivityScraper() Scraper

NewStatActivityScraper returns a new Scraper exposing postgres pg_stat_activity

func NewStatArchiverScraper added in v0.3.0

func NewStatArchiverScraper() Scraper

NewStatarchiverScraper returns a new Scraper exposing PostgreSQL `pg_stat_archiver` view

func NewStatBgwriterScraper added in v0.3.0

func NewStatBgwriterScraper() Scraper

NewStatBgwriterScraper returns a new Scraper exposing PostgreSQL `pg_stat_bgwriter` view

func NewStatDatabaseScraper added in v0.3.0

func NewStatDatabaseScraper() Scraper

NewStatDatabaseScraper returns a new Scraper exposing postgres pg_stat_database view The Statistics Scraper PostgreSQL's statistics collector is a subsystem that supports collection and reporting of information about server activity. Presently, the collector can count accesses to tables and indexes in both disk-block and individual-row terms. It also tracks the total number of rows in each table, and information about vacuum and analyze actions for each table. It can also count calls to user-defined functions and the total time spent in each one. https://www.postgresql.org/docs/9.4/static/monitoring-stats.html#PG-STAT-DATABASE-VIEW

func NewStatReplicationScraper added in v0.3.0

func NewStatReplicationScraper() Scraper

NewStatReplicationScraper returns a new Scraper exposing postgres pg_stat_replication

func NewStatUserIndexesScraper added in v0.10.0

func NewStatUserIndexesScraper() Scraper

NewStatUserIndexesScraper returns a new Scraper exposing postgres pg_stat_user_indexes view

func NewStatUserTablesScraper added in v0.3.0

func NewStatUserTablesScraper() Scraper

NewStatUserTablesScraper returns a new Scraper exposing postgres pg_stat_database view

func NewStatVacuumProgressScraper added in v0.5.0

func NewStatVacuumProgressScraper() Scraper

NewStatVacuumProgressScraper returns a new Scraper exposing postgres pg_stat_vacuum_progress_*

type Version added in v0.3.0

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

Postgres Version

func NewVersion added in v0.3.0

func NewVersion(v string) Version

func (Version) Gte added in v0.3.0

func (v Version) Gte(n float64) bool

func (Version) String added in v0.3.0

func (v Version) String() string

Jump to

Keyboard shortcuts

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