Documentation
¶
Overview ¶
Package mysqld_exporter embeds https://github.com/prometheus/mysqld_exporter
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ LockWaitTimeout: 2, InfoSchemaProcessListProcessesByUser: true, InfoSchemaProcessListProcessesByHost: true, InfoSchemaTablesDatabases: "*", PerfSchemaEventsStatementsLimit: 250, PerfSchemaEventsStatementsTimeLimit: 86400, PerfSchemaEventsStatementsTextLimit: 120, PerfSchemaFileInstancesFilter: ".*", PerfSchemaFileInstancesRemovePrefix: "/var/lib/mysql", PerfSchemaMemoryEventsRemovePrefix: "memory/", HeartbeatDatabase: "heartbeat", HeartbeatTable: "heartbeat", }
DefaultConfig holds the default settings for the mysqld_exporter integration.
Functions ¶
func GetScrapers ¶
GetScrapers returns the set of *enabled* scrapers from the config. Configurable scrapers will have their configuration filled out matching the Config's settings.
func New ¶
func New(log log.Logger, c *Config) (integrations.Integration, error)
New creates a new mysqld_exporter integration. The integration scrapes metrics from a mysqld process.
Types ¶
type Config ¶
type Config struct {
// DataSourceName to use to connect to MySQL.
DataSourceName config_util.Secret `yaml:"data_source_name,omitempty"`
// Collectors to mark as enabled in addition to the default.
EnableCollectors []string `yaml:"enable_collectors,omitempty"`
// Collectors to explicitly mark as disabled.
DisableCollectors []string `yaml:"disable_collectors,omitempty"`
// Overrides the default set of enabled collectors with the given list.
SetCollectors []string `yaml:"set_collectors,omitempty"`
// Collector-wide options
LockWaitTimeout int `yaml:"lock_wait_timeout,omitempty"`
LogSlowFilter bool `yaml:"log_slow_filter,omitempty"`
// Collector-specific config options
InfoSchemaProcessListMinTime int `yaml:"info_schema_processlist_min_time,omitempty"`
InfoSchemaProcessListProcessesByUser bool `yaml:"info_schema_processlist_processes_by_user,omitempty"`
InfoSchemaProcessListProcessesByHost bool `yaml:"info_schema_processlist_processes_by_host,omitempty"`
InfoSchemaTablesDatabases string `yaml:"info_schema_tables_databases,omitempty"`
PerfSchemaEventsStatementsLimit int `yaml:"perf_schema_eventsstatements_limit,omitempty"`
PerfSchemaEventsStatementsTimeLimit int `yaml:"perf_schema_eventsstatements_time_limit,omitempty"`
PerfSchemaEventsStatementsTextLimit int `yaml:"perf_schema_eventsstatements_digtext_text_limit,omitempty"`
PerfSchemaFileInstancesFilter string `yaml:"perf_schema_file_instances_filter,omitempty"`
PerfSchemaFileInstancesRemovePrefix string `yaml:"perf_schema_file_instances_remove_prefix,omitempty"`
PerfSchemaMemoryEventsRemovePrefix string `yaml:"perf_schema_memory_events_remove_prefix,omitempty"`
HeartbeatDatabase string `yaml:"heartbeat_database,omitempty"`
HeartbeatTable string `yaml:"heartbeat_table,omitempty"`
HeartbeatUTC bool `yaml:"heartbeat_utc,omitempty"`
MySQLUserPrivileges bool `yaml:"mysql_user_privileges,omitempty"`
}
Config controls the mysqld_exporter integration.
func (*Config) InstanceKey ¶
InstanceKey returns network(hostname:port)/dbname of the MySQL server.
func (*Config) NewIntegration ¶
func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error)
NewIntegration converts this config into an instance of an integration.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler for Config.
Click to show internal directories.
Click to hide internal directories.