Documentation ¶
Index ¶
- Variables
- type ColumnMapping
- type ColumnUsage
- type CustomQuery
- type Exporter
- type MetricMap
- type MetricMapNamespace
- type MetricResolution
- type Metrics
- type ScrapeAutoIncrementColumns
- type ScrapeBinlogSize
- type ScrapeClientStat
- type ScrapeCustomQuery
- type ScrapeEngineInnodbStatus
- type ScrapeEngineTokudbStatus
- type ScrapeGlobalStatus
- type ScrapeGlobalVariables
- type ScrapeHeartbeat
- type ScrapeInfoSchemaInnodbTablespaces
- type ScrapeInnodbCmp
- type ScrapeInnodbCmpMem
- type ScrapeInnodbMetrics
- type ScrapePerfEventsStatements
- type ScrapePerfEventsWaits
- type ScrapePerfFileEvents
- type ScrapePerfFileInstances
- type ScrapePerfIndexIOWaits
- type ScrapePerfTableIOWaits
- type ScrapePerfTableLockWaits
- type ScrapeProcesslist
- type ScrapeQueryResponseTime
- type ScrapeSlaveStatus
- type ScrapeTableSchema
- type ScrapeTableStat
- type ScrapeUserStat
- type Scraper
- Bugs
Constants ¶
This section is empty.
Variables ¶
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 ¶
type ColumnMapping struct {
// contains filtered or unexported fields
}
ColumnMapping is the user-friendly representation of a prometheus descriptor map.
func (*ColumnMapping) UnmarshalYAML ¶
func (cm *ColumnMapping) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements yaml.Unmarshaller.
type ColumnUsage ¶
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 ¶
func (cu *ColumnUsage) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaller interface.
type CustomQuery ¶
type CustomQuery struct {
// contains filtered or unexported fields
}
CustomQuery - contains MySQL query parsed from YAML file.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter collects MySQL metrics. It implements prometheus.Collector.
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 MetricMap ¶
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 ¶
type MetricMapNamespace struct {
// contains filtered or unexported fields
}
MetricMapNamespace groups metric maps under a shared set of labels.
type MetricResolution ¶
type MetricResolution string
const ( LR MetricResolution = "lr" MR MetricResolution = "mr" HR MetricResolution = "hr" )
type Metrics ¶
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 ¶
NewMetrics creates new Metrics instance.
type ScrapeAutoIncrementColumns ¶
type ScrapeAutoIncrementColumns struct{}
ScrapeAutoIncrementColumns collects auto_increment column information.
func (ScrapeAutoIncrementColumns) Help ¶
func (ScrapeAutoIncrementColumns) Help() string
Help returns additional information about Scraper.
func (ScrapeAutoIncrementColumns) Name ¶
func (ScrapeAutoIncrementColumns) Name() string
Name of the Scraper.
func (ScrapeAutoIncrementColumns) Scrape ¶
func (ScrapeAutoIncrementColumns) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeAutoIncrementColumns) Version ¶
func (ScrapeAutoIncrementColumns) Version() float64
Version of MySQL from which scraper is available.
type ScrapeBinlogSize ¶
type ScrapeBinlogSize struct{}
ScrapeBinlogSize colects from `SHOW BINARY LOGS`.
func (ScrapeBinlogSize) Help ¶
func (ScrapeBinlogSize) Help() string
Help returns additional information about Scraper.
func (ScrapeBinlogSize) Scrape ¶
func (ScrapeBinlogSize) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeBinlogSize) Version ¶
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 ¶
func (ScrapeClientStat) Help() string
Help returns additional information about Scraper.
func (ScrapeClientStat) Scrape ¶
func (ScrapeClientStat) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeClientStat) Version ¶
func (ScrapeClientStat) Version() float64
Version of MySQL from which scraper is available.
type ScrapeCustomQuery ¶
type ScrapeCustomQuery struct {
Resolution MetricResolution
}
ScrapeCustomQuery colects the metrics from custom queries.
func (ScrapeCustomQuery) Help ¶
func (scq ScrapeCustomQuery) Help() string
Help returns additional information about Scraper.
func (ScrapeCustomQuery) Scrape ¶
func (scq ScrapeCustomQuery) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeCustomQuery) Version ¶
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 ¶
func (ScrapeEngineInnodbStatus) Help() string
Help returns additional information about Scraper.
func (ScrapeEngineInnodbStatus) Name ¶
func (ScrapeEngineInnodbStatus) Name() string
Name of the Scraper.
func (ScrapeEngineInnodbStatus) Scrape ¶
func (ScrapeEngineInnodbStatus) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeEngineInnodbStatus) Version ¶
func (ScrapeEngineInnodbStatus) Version() float64
Version of MySQL from which scraper is available.
type ScrapeEngineTokudbStatus ¶
type ScrapeEngineTokudbStatus struct{}
ScrapeEngineTokudbStatus scrapes from `SHOW ENGINE TOKUDB STATUS`.
func (ScrapeEngineTokudbStatus) Help ¶
func (ScrapeEngineTokudbStatus) Help() string
Help returns additional information about Scraper.
func (ScrapeEngineTokudbStatus) Name ¶
func (ScrapeEngineTokudbStatus) Name() string
Name of the Scraper.
func (ScrapeEngineTokudbStatus) Scrape ¶
func (ScrapeEngineTokudbStatus) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeEngineTokudbStatus) Version ¶
func (ScrapeEngineTokudbStatus) Version() float64
Version of MySQL from which scraper is available.
type ScrapeGlobalStatus ¶
type ScrapeGlobalStatus struct{}
ScrapeGlobalStatus collects from `SHOW GLOBAL STATUS`.
func (ScrapeGlobalStatus) Help ¶
func (ScrapeGlobalStatus) Help() string
Help returns additional information about Scraper.
func (ScrapeGlobalStatus) Scrape ¶
func (ScrapeGlobalStatus) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeGlobalStatus) Version ¶
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 ¶
func (ScrapeGlobalVariables) Help() string
Help returns additional information about Scraper.
func (ScrapeGlobalVariables) Scrape ¶
func (ScrapeGlobalVariables) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeGlobalVariables) Version ¶
func (ScrapeGlobalVariables) Version() float64
Version of MySQL from which scraper is available.
type ScrapeHeartbeat ¶
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 ¶
func (ScrapeHeartbeat) Help() string
Help returns additional information about Scraper.
func (ScrapeHeartbeat) Scrape ¶
func (ScrapeHeartbeat) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeHeartbeat) Version ¶
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 ¶
func (ScrapeInfoSchemaInnodbTablespaces) Help() string
Help returns additional information about Scraper.
func (ScrapeInfoSchemaInnodbTablespaces) Name ¶
func (ScrapeInfoSchemaInnodbTablespaces) Name() string
Name of the Scraper.
func (ScrapeInfoSchemaInnodbTablespaces) Scrape ¶
func (ScrapeInfoSchemaInnodbTablespaces) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeInfoSchemaInnodbTablespaces) Version ¶
func (ScrapeInfoSchemaInnodbTablespaces) Version() float64
Version of MySQL from which scraper is available.
type ScrapeInnodbCmp ¶
type ScrapeInnodbCmp struct{}
ScrapeInnodbCmp collects from `information_schema.innodb_cmp`.
func (ScrapeInnodbCmp) Help ¶
func (ScrapeInnodbCmp) Help() string
Help returns additional information about Scraper.
func (ScrapeInnodbCmp) Scrape ¶
func (ScrapeInnodbCmp) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeInnodbCmp) Version ¶
func (ScrapeInnodbCmp) Version() float64
Version of MySQL from which scraper is available.
type ScrapeInnodbCmpMem ¶
type ScrapeInnodbCmpMem struct{}
ScrapeInnodbCmpMem collects from `information_schema.innodb_cmpmem`.
func (ScrapeInnodbCmpMem) Help ¶
func (ScrapeInnodbCmpMem) Help() string
Help returns additional information about Scraper.
func (ScrapeInnodbCmpMem) Scrape ¶
func (ScrapeInnodbCmpMem) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeInnodbCmpMem) Version ¶
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 ¶
func (ScrapeInnodbMetrics) Help() string
Help returns additional information about Scraper.
func (ScrapeInnodbMetrics) Scrape ¶
func (ScrapeInnodbMetrics) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeInnodbMetrics) Version ¶
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 ¶
func (ScrapePerfEventsStatements) Help() string
Help returns additional information about Scraper.
func (ScrapePerfEventsStatements) Name ¶
func (ScrapePerfEventsStatements) Name() string
Name of the Scraper.
func (ScrapePerfEventsStatements) Scrape ¶
func (ScrapePerfEventsStatements) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapePerfEventsStatements) Version ¶
func (ScrapePerfEventsStatements) Version() float64
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 ¶
func (ScrapePerfEventsWaits) Help() string
Help returns additional information about Scraper.
func (ScrapePerfEventsWaits) Scrape ¶
func (ScrapePerfEventsWaits) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapePerfEventsWaits) Version ¶
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 ¶
func (ScrapePerfFileEvents) Help() string
Help returns additional information about Scraper.
func (ScrapePerfFileEvents) Scrape ¶
func (ScrapePerfFileEvents) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapePerfFileEvents) Version ¶
func (ScrapePerfFileEvents) Version() float64
Version of MySQL from which scraper is available.
type ScrapePerfFileInstances ¶
type ScrapePerfFileInstances struct{}
ScrapePerfFileInstances collects from `performance_schema.file_summary_by_instance`.
func (ScrapePerfFileInstances) Help ¶
func (ScrapePerfFileInstances) Help() string
Help returns additional information about Scraper.
func (ScrapePerfFileInstances) Name ¶
func (ScrapePerfFileInstances) Name() string
Name of the Scraper.
func (ScrapePerfFileInstances) Scrape ¶
func (ScrapePerfFileInstances) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapePerfFileInstances) Version ¶
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 ¶
func (ScrapePerfIndexIOWaits) Help() string
Help returns additional information about Scraper.
func (ScrapePerfIndexIOWaits) Name ¶
func (ScrapePerfIndexIOWaits) Name() string
Name of the Scraper.
func (ScrapePerfIndexIOWaits) Scrape ¶
func (ScrapePerfIndexIOWaits) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapePerfIndexIOWaits) Version ¶
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 ¶
func (ScrapePerfTableIOWaits) Help() string
Help returns additional information about Scraper.
func (ScrapePerfTableIOWaits) Name ¶
func (ScrapePerfTableIOWaits) Name() string
Name of the Scraper.
func (ScrapePerfTableIOWaits) Scrape ¶
func (ScrapePerfTableIOWaits) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapePerfTableIOWaits) Version ¶
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 ¶
func (ScrapePerfTableLockWaits) Help() string
Help returns additional information about Scraper.
func (ScrapePerfTableLockWaits) Name ¶
func (ScrapePerfTableLockWaits) Name() string
Name of the Scraper.
func (ScrapePerfTableLockWaits) Scrape ¶
func (ScrapePerfTableLockWaits) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapePerfTableLockWaits) Version ¶
func (ScrapePerfTableLockWaits) Version() float64
Version of MySQL from which scraper is available.
type ScrapeProcesslist ¶
type ScrapeProcesslist struct{}
ScrapeProcesslist collects from `information_schema.processlist`.
func (ScrapeProcesslist) Help ¶
func (ScrapeProcesslist) Help() string
Help returns additional information about Scraper.
func (ScrapeProcesslist) Scrape ¶
func (ScrapeProcesslist) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeProcesslist) Version ¶
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 ¶
func (ScrapeQueryResponseTime) Help() string
Help returns additional information about Scraper.
func (ScrapeQueryResponseTime) Name ¶
func (ScrapeQueryResponseTime) Name() string
Name of the Scraper.
func (ScrapeQueryResponseTime) Scrape ¶
func (ScrapeQueryResponseTime) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeQueryResponseTime) Version ¶
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 ¶
func (ScrapeSlaveStatus) Help() string
Help returns additional information about Scraper.
func (ScrapeSlaveStatus) Scrape ¶
func (ScrapeSlaveStatus) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeSlaveStatus) Version ¶
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 ¶
func (ScrapeTableSchema) Help() string
Help returns additional information about Scraper.
func (ScrapeTableSchema) Scrape ¶
func (ScrapeTableSchema) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeTableSchema) Version ¶
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 ¶
func (ScrapeTableStat) Help() string
Help returns additional information about Scraper.
func (ScrapeTableStat) Scrape ¶
func (ScrapeTableStat) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeTableStat) Version ¶
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 ¶
func (ScrapeUserStat) Help() string
Help returns additional information about Scraper.
func (ScrapeUserStat) Scrape ¶
func (ScrapeUserStat) Scrape(ctx context.Context, db *sql.DB, ch chan<- prometheus.Metric) error
Scrape collects data.
func (ScrapeUserStat) Version ¶
func (ScrapeUserStat) Version() float64
Version of MySQL from which scraper is available.
Notes ¶
Bugs ¶
PMM-2726: When PingContext returns with context deadline exceeded the subsequent call will return `bad connection`. https://github.com/go-sql-driver/mysql/issues/858 The PingContext is called second time as a workaround for this issue.
Source Files ¶
- binlog.go
- collector.go
- custom_query.go
- engine_innodb.go
- engine_tokudb.go
- exporter.go
- global_status.go
- global_variables.go
- heartbeat.go
- info_schema.go
- info_schema_auto_increment.go
- info_schema_clientstats.go
- info_schema_innodb_cmp.go
- info_schema_innodb_cmpmem.go
- info_schema_innodb_metrics.go
- info_schema_innodb_sys_tablespaces.go
- info_schema_processlist.go
- info_schema_query_response_time.go
- info_schema_tables.go
- info_schema_tablestats.go
- info_schema_userstats.go
- perf_schema.go
- perf_schema_events_statements.go
- perf_schema_events_waits.go
- perf_schema_file_events.go
- perf_schema_file_instances.go
- perf_schema_index_io_waits.go
- perf_schema_table_io_waits.go
- perf_schema_table_lock_waits.go
- scraper.go
- slave_status.go
- standard.go