Documentation ¶
Index ¶
- type Exporter
- type Metrics
- type ScrapeActivity
- type ScrapeArchiver
- type ScrapeBgWriter
- type ScrapeDatabase
- type ScrapeDatabaseConflicts
- type ScrapeIOTables
- type ScrapeInfo
- type ScrapeLocks
- type ScrapePreparedXacts
- type ScrapeReplication
- type ScrapeReplicationSlots
- type ScrapeSettings
- type ScrapeStatements
- type ScrapeTXID
- type ScrapeTables
- type ScrapeType
- type ScrapeWal
- type Scraper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter collects MySQL metrics. It implements prometheus.Collector.
func New ¶
func New(ctx context.Context, pgoptions []pgdriver.Option, metrics Metrics, scrapers []Scraper) *Exporter
New returns a PostgreSQL exporter for the provided DSN.
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
type Metrics ¶
type Metrics struct { TotalScrapes prometheus.Counter ScrapeErrors *prometheus.CounterVec Error prometheus.Gauge PgSQLUp prometheus.Gauge }
Metrics represents exporter metrics which values can be carried between http requests.
type ScrapeActivity ¶
type ScrapeActivity struct{}
ScrapeActivity scrapes from pg_stat_bgwriter
func (ScrapeActivity) Help ¶
func (ScrapeActivity) Help() string
Help describes the role of the Scraper
func (ScrapeActivity) Scrape ¶
func (ScrapeActivity) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeActivity) Version ¶
func (ScrapeActivity) Version() int
Version returns minimum PostgreSQL version
type ScrapeArchiver ¶
type ScrapeArchiver struct{}
ScrapeArchiver scrapes from pg_stat_archiver
func (ScrapeArchiver) Help ¶
func (ScrapeArchiver) Help() string
Help describes the role of the Scraper
func (ScrapeArchiver) Scrape ¶
func (ScrapeArchiver) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeArchiver) Version ¶
func (ScrapeArchiver) Version() int
Version returns minimum PostgreSQL version
type ScrapeBgWriter ¶
type ScrapeBgWriter struct{}
ScrapeBgWriter scrapes from pg_stat_bgwriter
func (ScrapeBgWriter) Help ¶
func (ScrapeBgWriter) Help() string
Help describes the role of the Scraper
func (ScrapeBgWriter) Scrape ¶
func (ScrapeBgWriter) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeBgWriter) Version ¶
func (ScrapeBgWriter) Version() int
Version returns minimum PostgreSQL version
type ScrapeDatabase ¶
type ScrapeDatabase struct{}
ScrapeDatabase scrapes from pg_stat_database
func (ScrapeDatabase) Help ¶
func (ScrapeDatabase) Help() string
Help describes the role of the Scraper
func (ScrapeDatabase) Scrape ¶
func (ScrapeDatabase) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeDatabase) Version ¶
func (ScrapeDatabase) Version() int
Version returns minimum PostgreSQL version
type ScrapeDatabaseConflicts ¶
type ScrapeDatabaseConflicts struct{}
ScrapeDatabaseConflicts scrapes from pg_stat_database_conflicts
func (ScrapeDatabaseConflicts) Help ¶
func (ScrapeDatabaseConflicts) Help() string
Help describes the role of the Scraper
func (ScrapeDatabaseConflicts) Name ¶
func (ScrapeDatabaseConflicts) Name() string
Name of the Scraper
func (ScrapeDatabaseConflicts) Scrape ¶
func (ScrapeDatabaseConflicts) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeDatabaseConflicts) Type ¶
func (ScrapeDatabaseConflicts) Type() ScrapeType
Type returns the scrape type
func (ScrapeDatabaseConflicts) Version ¶
func (ScrapeDatabaseConflicts) Version() int
Version returns minimum PostgreSQL version
type ScrapeIOTables ¶
type ScrapeIOTables struct{}
ScrapeIOTables scrapes from pg_statio_user_tables
func (ScrapeIOTables) Help ¶
func (ScrapeIOTables) Help() string
Help describes the role of the Scraper
func (ScrapeIOTables) Scrape ¶
func (ScrapeIOTables) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeIOTables) Version ¶
func (ScrapeIOTables) Version() int
Version returns minimum PostgreSQL version
type ScrapeInfo ¶
type ScrapeInfo struct{}
ScrapeInfo scrapes generic PostgreSQL information
func (ScrapeInfo) Scrape ¶
func (ScrapeInfo) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeInfo) Version ¶
func (ScrapeInfo) Version() int
Version returns minimum PostgreSQL version
type ScrapeLocks ¶
type ScrapeLocks struct{}
ScrapeLocks scrapes from pg_locks
func (ScrapeLocks) Scrape ¶
func (ScrapeLocks) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeLocks) Version ¶
func (ScrapeLocks) Version() int
Version returns minimum PostgreSQL version
type ScrapePreparedXacts ¶
type ScrapePreparedXacts struct{}
ScrapePreparedXacts scrapes from pg_prepared_xacts
func (ScrapePreparedXacts) Help ¶
func (ScrapePreparedXacts) Help() string
Help describes the role of the Scraper
func (ScrapePreparedXacts) Scrape ¶
func (ScrapePreparedXacts) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapePreparedXacts) Type ¶
func (ScrapePreparedXacts) Type() ScrapeType
Type returns the scrape type
func (ScrapePreparedXacts) Version ¶
func (ScrapePreparedXacts) Version() int
Version returns minimum PostgreSQL version
type ScrapeReplication ¶
type ScrapeReplication struct{}
ScrapeReplication scrapes from pg_stat_replication
func (ScrapeReplication) Help ¶
func (ScrapeReplication) Help() string
Help describes the role of the Scraper
func (ScrapeReplication) Scrape ¶
func (ScrapeReplication) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeReplication) Type ¶
func (ScrapeReplication) Type() ScrapeType
Type returns the scrape type
func (ScrapeReplication) Version ¶
func (ScrapeReplication) Version() int
Version returns minimum PostgreSQL version
type ScrapeReplicationSlots ¶
type ScrapeReplicationSlots struct{}
ScrapeReplicationSlots scrapes from pg_stat_replication_slots
func (ScrapeReplicationSlots) Help ¶
func (ScrapeReplicationSlots) Help() string
Help describes the role of the Scraper
func (ScrapeReplicationSlots) Name ¶
func (ScrapeReplicationSlots) Name() string
Name of the Scraper
func (ScrapeReplicationSlots) Scrape ¶
func (ScrapeReplicationSlots) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeReplicationSlots) Type ¶
func (ScrapeReplicationSlots) Type() ScrapeType
Type returns the scrape type
func (ScrapeReplicationSlots) Version ¶
func (ScrapeReplicationSlots) Version() int
Version returns minimum PostgreSQL version
type ScrapeSettings ¶
type ScrapeSettings struct{}
ScrapeSettings scrapes from pg_settings
func (ScrapeSettings) Help ¶
func (ScrapeSettings) Help() string
Help describes the role of the Scraper
func (ScrapeSettings) Scrape ¶
func (ScrapeSettings) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeSettings) Version ¶
func (ScrapeSettings) Version() int
Version returns minimum PostgreSQL version
type ScrapeStatements ¶
type ScrapeStatements struct{}
ScrapeStatements scrapes from pg_stat_statements
func (ScrapeStatements) Help ¶
func (ScrapeStatements) Help() string
Help describes the role of the Scraper
func (ScrapeStatements) Scrape ¶
func (ScrapeStatements) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeStatements) Type ¶
func (ScrapeStatements) Type() ScrapeType
Type returns the scrape type
func (ScrapeStatements) Version ¶
func (ScrapeStatements) Version() int
Version returns minimum PostgreSQL version
type ScrapeTXID ¶
type ScrapeTXID struct{}
ScrapeTXID scrapes from txid_current()
func (ScrapeTXID) Scrape ¶
func (ScrapeTXID) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeTXID) Version ¶
func (ScrapeTXID) Version() int
Version returns minimum PostgreSQL version
type ScrapeTables ¶
type ScrapeTables struct{}
ScrapeTables scrapes from pg_stat_user_tables
func (ScrapeTables) Scrape ¶
func (ScrapeTables) Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error
Scrape collects data from database connection and sends it over channel as prometheus metric.
func (ScrapeTables) Version ¶
func (ScrapeTables) Version() int
Version returns minimum PostgreSQL version
type ScrapeWal ¶
type ScrapeWal struct{}
ScrapeWal scrapes from pg_stat_wal
type Scraper ¶
type Scraper interface { // Name of the Scraper. Should be unique. Name() string // Help describes the role of the Scraper. Help() string // Version of PostgreSQL from which scraper is available. Version() int // Type defines the scrape type Type() ScrapeType // Scrape collects data from database connection and sends it over channel as prometheus metric. Scrape(ctx context.Context, db *bun.DB, ch chan<- prometheus.Metric) error }
Scraper is minimal interface that let's you add new prometheus metrics to pg_exporter.