collector

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HeartbeatStoredDesc = prometheus.NewDesc(
		prometheus.BuildFQName(namespace, heartbeat, "stored_timestamp_seconds"),
		"Timestamp stored in the heartbeat table.",
		[]string{"server_id"}, nil,
	)
	HeartbeatNowDesc = prometheus.NewDesc(
		prometheus.BuildFQName(namespace, heartbeat, "now_timestamp_seconds"),
		"Timestamp of the current server.",
		[]string{"server_id"}, nil,
	)
)

Metric descriptors.

Functions

This section is empty.

Types

type ColumnMapping added in v0.10.1

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

ColumnMapping is the user-friendly representation of a prometheus descriptor map.

func (*ColumnMapping) UnmarshalYAML added in v0.10.1

func (cm *ColumnMapping) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaller.

type ColumnUsage added in v0.10.1

type ColumnUsage int

ColumnUsage should be one of several enum values which describe how a queried row is to be converted to a Prometheus metric.

func (*ColumnUsage) UnmarshalYAML added in v0.10.1

func (cu *ColumnUsage) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaller interface.

type CustomQuery added in v0.10.1

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

CustomQuery - contains MySQL query parsed from YAML file.

type Exporter added in v0.10.1

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

Exporter collects MySQL metrics. It implements prometheus.Collector.

func New added in v0.10.1

func New(ctx context.Context, db *sql.DB, metrics Metrics, scrapers []Scraper) *Exporter

New returns a new MySQL exporter for the provided DSN.

func (*Exporter) Collect added in v0.10.1

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

Collect implements prometheus.Collector.

func (*Exporter) Describe added in v0.10.1

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

Describe implements prometheus.Collector.

type MetricMap added in v0.10.1

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

MetricMap stores the prometheus metric description which a given column will be mapped to by the collector.

type MetricMapNamespace added in v0.10.1

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

MetricMapNamespace groups metric maps under a shared set of labels.

type MetricResolution added in v0.10.1

type MetricResolution string
const (
	LR MetricResolution = "lr"
	MR MetricResolution = "mr"
	HR MetricResolution = "hr"
)

type Metrics added in v0.10.1

type Metrics struct {
	TotalScrapes prometheus.Counter
	ScrapeErrors *prometheus.CounterVec
	Error        prometheus.Gauge
	MySQLUp      prometheus.Gauge
}

Metrics represents exporter metrics which values can be carried between http requests.

func NewMetrics added in v0.10.1

func NewMetrics(resolution string) Metrics

NewMetrics creates new Metrics instance.

type ScrapeAutoIncrementColumns

type ScrapeAutoIncrementColumns struct{}

ScrapeAutoIncrementColumns collects auto_increment column information.

func (ScrapeAutoIncrementColumns) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapeAutoIncrementColumns) Name added in v0.10.1

Name of the Scraper.

func (ScrapeAutoIncrementColumns) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeAutoIncrementColumns) Version added in v0.10.1

Version of MySQL from which scraper is available.

type ScrapeBinlogSize

type ScrapeBinlogSize struct{}

ScrapeBinlogSize colects from `SHOW BINARY LOGS`.

func (ScrapeBinlogSize) Help added in v0.10.1

func (ScrapeBinlogSize) Help() string

Help returns additional information about Scraper.

func (ScrapeBinlogSize) Name added in v0.10.1

func (ScrapeBinlogSize) Name() string

Name of the Scraper.

func (ScrapeBinlogSize) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeBinlogSize) Version added in v0.10.1

func (ScrapeBinlogSize) Version() float64

Version of MySQL from which scraper is available.

type ScrapeClientStat

type ScrapeClientStat struct{}

ScrapeClientStat collects from `information_schema.client_statistics`.

func (ScrapeClientStat) Help added in v0.10.1

func (ScrapeClientStat) Help() string

Help returns additional information about Scraper.

func (ScrapeClientStat) Name added in v0.10.1

func (ScrapeClientStat) Name() string

Name of the Scraper.

func (ScrapeClientStat) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeClientStat) Version added in v0.10.1

func (ScrapeClientStat) Version() float64

Version of MySQL from which scraper is available.

type ScrapeCustomQuery added in v0.10.1

type ScrapeCustomQuery struct {
	Resolution MetricResolution
}

ScrapeCustomQuery colects the metrics from custom queries.

func (ScrapeCustomQuery) Help added in v0.10.1

func (scq ScrapeCustomQuery) Help() string

Help returns additional information about Scraper.

func (ScrapeCustomQuery) Name added in v0.10.1

func (scq ScrapeCustomQuery) Name() string

Name of the Scraper.

func (ScrapeCustomQuery) Scrape added in v0.10.1

func (scq ScrapeCustomQuery) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error

Scrape collects data.

func (ScrapeCustomQuery) Version added in v0.10.1

func (scq ScrapeCustomQuery) Version() float64

Version of MySQL from which scraper is available.

type ScrapeEngineInnodbStatus

type ScrapeEngineInnodbStatus struct{}

ScrapeEngineInnodbStatus scrapes from `SHOW ENGINE INNODB STATUS`.

func (ScrapeEngineInnodbStatus) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapeEngineInnodbStatus) Name added in v0.10.1

Name of the Scraper.

func (ScrapeEngineInnodbStatus) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeEngineInnodbStatus) Version added in v0.10.1

Version of MySQL from which scraper is available.

type ScrapeEngineTokudbStatus

type ScrapeEngineTokudbStatus struct{}

ScrapeEngineTokudbStatus scrapes from `SHOW ENGINE TOKUDB STATUS`.

func (ScrapeEngineTokudbStatus) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapeEngineTokudbStatus) Name added in v0.10.1

Name of the Scraper.

func (ScrapeEngineTokudbStatus) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeEngineTokudbStatus) Version added in v0.10.1

Version of MySQL from which scraper is available.

type ScrapeGlobalStatus

type ScrapeGlobalStatus struct{}

ScrapeGlobalStatus collects from `SHOW GLOBAL STATUS`.

func (ScrapeGlobalStatus) Help added in v0.10.1

func (ScrapeGlobalStatus) Help() string

Help returns additional information about Scraper.

func (ScrapeGlobalStatus) Name added in v0.10.1

func (ScrapeGlobalStatus) Name() string

Name of the Scraper.

func (ScrapeGlobalStatus) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeGlobalStatus) Version added in v0.10.1

func (ScrapeGlobalStatus) Version() float64

Version of MySQL from which scraper is available.

type ScrapeGlobalVariables

type ScrapeGlobalVariables struct{}

ScrapeGlobalVariables collects from `SHOW GLOBAL VARIABLES`.

func (ScrapeGlobalVariables) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapeGlobalVariables) Name added in v0.10.1

Name of the Scraper.

func (ScrapeGlobalVariables) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeGlobalVariables) Version added in v0.10.1

func (ScrapeGlobalVariables) Version() float64

Version of MySQL from which scraper is available.

type ScrapeHeartbeat added in v0.10.0

type ScrapeHeartbeat struct{}

ScrapeHeartbeat scrapes from the heartbeat table. This is mainly targeting pt-heartbeat, but will work with any heartbeat implementation that writes to a table with two columns: CREATE TABLE heartbeat (

ts                    varchar(26) NOT NULL,
server_id             int unsigned NOT NULL PRIMARY KEY,

);

func (ScrapeHeartbeat) Help added in v0.10.1

func (ScrapeHeartbeat) Help() string

Help returns additional information about Scraper.

func (ScrapeHeartbeat) Name added in v0.10.1

func (ScrapeHeartbeat) Name() string

Name of the Scraper.

func (ScrapeHeartbeat) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeHeartbeat) Version added in v0.10.1

func (ScrapeHeartbeat) Version() float64

Version of MySQL from which scraper is available.

type ScrapeInfoSchemaInnodbTablespaces

type ScrapeInfoSchemaInnodbTablespaces struct{}

ScrapeInfoSchemaInnodbTablespaces collects from `information_schema.innodb_sys_tablespaces`.

func (ScrapeInfoSchemaInnodbTablespaces) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapeInfoSchemaInnodbTablespaces) Name added in v0.10.1

Name of the Scraper.

func (ScrapeInfoSchemaInnodbTablespaces) Scrape added in v0.10.1

Scrape collects data.

func (ScrapeInfoSchemaInnodbTablespaces) Version added in v0.10.1

Version of MySQL from which scraper is available.

type ScrapeInnodbCmp added in v0.10.1

type ScrapeInnodbCmp struct{}

ScrapeInnodbCmp collects from `information_schema.innodb_cmp`.

func (ScrapeInnodbCmp) Help added in v0.10.1

func (ScrapeInnodbCmp) Help() string

Help returns additional information about Scraper.

func (ScrapeInnodbCmp) Name added in v0.10.1

func (ScrapeInnodbCmp) Name() string

Name of the Scraper.

func (ScrapeInnodbCmp) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeInnodbCmp) Version added in v0.10.1

func (ScrapeInnodbCmp) Version() float64

Version of MySQL from which scraper is available.

type ScrapeInnodbCmpMem added in v0.10.1

type ScrapeInnodbCmpMem struct{}

ScrapeInnodbCmpMem collects from `information_schema.innodb_cmpmem`.

func (ScrapeInnodbCmpMem) Help added in v0.10.1

func (ScrapeInnodbCmpMem) Help() string

Help returns additional information about Scraper.

func (ScrapeInnodbCmpMem) Name added in v0.10.1

func (ScrapeInnodbCmpMem) Name() string

Name of the Scraper.

func (ScrapeInnodbCmpMem) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeInnodbCmpMem) Version added in v0.10.1

func (ScrapeInnodbCmpMem) Version() float64

Version of MySQL from which scraper is available.

type ScrapeInnodbMetrics

type ScrapeInnodbMetrics struct{}

ScrapeInnodbMetrics collects from `information_schema.innodb_metrics`.

func (ScrapeInnodbMetrics) Help added in v0.10.1

func (ScrapeInnodbMetrics) Help() string

Help returns additional information about Scraper.

func (ScrapeInnodbMetrics) Name added in v0.10.1

func (ScrapeInnodbMetrics) Name() string

Name of the Scraper.

func (ScrapeInnodbMetrics) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeInnodbMetrics) Version added in v0.10.1

func (ScrapeInnodbMetrics) Version() float64

Version of MySQL from which scraper is available.

type ScrapePerfEventsStatements

type ScrapePerfEventsStatements struct{}

ScrapePerfEventsStatements collects from `performance_schema.events_statements_summary_by_digest`.

func (ScrapePerfEventsStatements) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapePerfEventsStatements) Name added in v0.10.1

Name of the Scraper.

func (ScrapePerfEventsStatements) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapePerfEventsStatements) Version added in v0.10.1

Version of MySQL from which scraper is available.

type ScrapePerfEventsWaits

type ScrapePerfEventsWaits struct{}

ScrapePerfEventsWaits collects from `performance_schema.events_waits_summary_global_by_event_name`.

func (ScrapePerfEventsWaits) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapePerfEventsWaits) Name added in v0.10.1

Name of the Scraper.

func (ScrapePerfEventsWaits) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapePerfEventsWaits) Version added in v0.10.1

func (ScrapePerfEventsWaits) Version() float64

Version of MySQL from which scraper is available.

type ScrapePerfFileEvents

type ScrapePerfFileEvents struct{}

ScrapePerfFileEvents collects from `performance_schema.file_summary_by_event_name`.

func (ScrapePerfFileEvents) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapePerfFileEvents) Name added in v0.10.1

Name of the Scraper.

func (ScrapePerfFileEvents) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapePerfFileEvents) Version added in v0.10.1

func (ScrapePerfFileEvents) Version() float64

Version of MySQL from which scraper is available.

type ScrapePerfFileInstances added in v0.10.0

type ScrapePerfFileInstances struct{}

ScrapePerfFileInstances collects from `performance_schema.file_summary_by_instance`.

func (ScrapePerfFileInstances) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapePerfFileInstances) Name added in v0.10.1

Name of the Scraper.

func (ScrapePerfFileInstances) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapePerfFileInstances) Version added in v0.10.1

func (ScrapePerfFileInstances) Version() float64

Version of MySQL from which scraper is available.

type ScrapePerfIndexIOWaits

type ScrapePerfIndexIOWaits struct{}

ScrapePerfIndexIOWaits collects for `performance_schema.table_io_waits_summary_by_index_usage`.

func (ScrapePerfIndexIOWaits) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapePerfIndexIOWaits) Name added in v0.10.1

Name of the Scraper.

func (ScrapePerfIndexIOWaits) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapePerfIndexIOWaits) Version added in v0.10.1

func (ScrapePerfIndexIOWaits) Version() float64

Version of MySQL from which scraper is available.

type ScrapePerfTableIOWaits

type ScrapePerfTableIOWaits struct{}

ScrapePerfTableIOWaits collects from `performance_schema.table_io_waits_summary_by_table`.

func (ScrapePerfTableIOWaits) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapePerfTableIOWaits) Name added in v0.10.1

Name of the Scraper.

func (ScrapePerfTableIOWaits) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapePerfTableIOWaits) Version added in v0.10.1

func (ScrapePerfTableIOWaits) Version() float64

Version of MySQL from which scraper is available.

type ScrapePerfTableLockWaits

type ScrapePerfTableLockWaits struct{}

ScrapePerfTableLockWaits collects from `performance_schema.table_lock_waits_summary_by_table`.

func (ScrapePerfTableLockWaits) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapePerfTableLockWaits) Name added in v0.10.1

Name of the Scraper.

func (ScrapePerfTableLockWaits) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapePerfTableLockWaits) Version added in v0.10.1

Version of MySQL from which scraper is available.

type ScrapeProcesslist

type ScrapeProcesslist struct{}

ScrapeProcesslist collects from `information_schema.processlist`.

func (ScrapeProcesslist) Help added in v0.10.1

func (ScrapeProcesslist) Help() string

Help returns additional information about Scraper.

func (ScrapeProcesslist) Name added in v0.10.1

func (ScrapeProcesslist) Name() string

Name of the Scraper.

func (ScrapeProcesslist) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeProcesslist) Version added in v0.10.1

func (ScrapeProcesslist) Version() float64

Version of MySQL from which scraper is available.

type ScrapeQueryResponseTime

type ScrapeQueryResponseTime struct{}

ScrapeQueryResponseTime collects from `information_schema.query_response_time`.

func (ScrapeQueryResponseTime) Help added in v0.10.1

Help returns additional information about Scraper.

func (ScrapeQueryResponseTime) Name added in v0.10.1

Name of the Scraper.

func (ScrapeQueryResponseTime) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeQueryResponseTime) Version added in v0.10.1

func (ScrapeQueryResponseTime) Version() float64

Version of MySQL from which scraper is available.

type ScrapeSlaveStatus

type ScrapeSlaveStatus struct{}

ScrapeSlaveStatus collects from `SHOW SLAVE STATUS`.

func (ScrapeSlaveStatus) Help added in v0.10.1

func (ScrapeSlaveStatus) Help() string

Help returns additional information about Scraper.

func (ScrapeSlaveStatus) Name added in v0.10.1

func (ScrapeSlaveStatus) Name() string

Name of the Scraper.

func (ScrapeSlaveStatus) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeSlaveStatus) Version added in v0.10.1

func (ScrapeSlaveStatus) Version() float64

Version of MySQL from which scraper is available.

type ScrapeTableSchema

type ScrapeTableSchema struct{}

ScrapeTableSchema collects from `information_schema.tables`.

func (ScrapeTableSchema) Help added in v0.10.1

func (ScrapeTableSchema) Help() string

Help returns additional information about Scraper.

func (ScrapeTableSchema) Name added in v0.10.1

func (ScrapeTableSchema) Name() string

Name of the Scraper.

func (ScrapeTableSchema) Scrape added in v0.10.1

func (ScrapeTableSchema) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) (e error)

Scrape collects data.

func (ScrapeTableSchema) Version added in v0.10.1

func (ScrapeTableSchema) Version() float64

Version of MySQL from which scraper is available.

type ScrapeTableStat

type ScrapeTableStat struct{}

ScrapeTableStat collects from `information_schema.table_statistics`.

func (ScrapeTableStat) Help added in v0.10.1

func (ScrapeTableStat) Help() string

Help returns additional information about Scraper.

func (ScrapeTableStat) Name added in v0.10.1

func (ScrapeTableStat) Name() string

Name of the Scraper.

func (ScrapeTableStat) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeTableStat) Version added in v0.10.1

func (ScrapeTableStat) Version() float64

Version of MySQL from which scraper is available.

type ScrapeUserStat

type ScrapeUserStat struct{}

ScrapeUserStat collects from `information_schema.user_statistics`.

func (ScrapeUserStat) Help added in v0.10.1

func (ScrapeUserStat) Help() string

Help returns additional information about Scraper.

func (ScrapeUserStat) Name added in v0.10.1

func (ScrapeUserStat) Name() string

Name of the Scraper.

func (ScrapeUserStat) Scrape added in v0.10.1

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

Scrape collects data.

func (ScrapeUserStat) Version added in v0.10.1

func (ScrapeUserStat) Version() float64

Version of MySQL from which scraper is available.

type Scraper added in v0.10.1

type Scraper interface {
	Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
	Name() string
	Help() string
	Version() float64
}

func NewStandardGo added in v0.10.1

func NewStandardGo() Scraper

func NewStandardProcess added in v0.10.1

func NewStandardProcess() Scraper

Notes

Bugs

Jump to

Keyboard shortcuts

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