Documentation
¶
Overview ¶
Package mysqld_exporter embeds https://github.com/prometheus/mysqld_exporter
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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.
Types ¶
type Config ¶
type Config struct { // Enabled enables the integration. Enabled bool `yaml:"enabled"` CommonConfig config.Common `yaml:",inline"` // DataSourceName to use to connect to MySQL. DataSourceName string `yaml:"data_source_name"` // Collectors to mark as enabled in addition to the default. EnableCollectors []string `yaml:"enable_collectors"` // Collectors to explicitly mark as disabled. DisableCollectors []string `yaml:"disable_collectors"` // Overrides the default set of enabled collectors with the given list. SetCollectors []string `yaml:"set_collectors"` // Collector-wide options LockWaitTimeout int `yaml:"lock_wait_timeout"` LogSlowFilter bool `yaml:"log_slow_filter"` // Collector-specific config options InfoSchemaProcessListMinTime int `yaml:"info_schema_processlist_min_time"` InfoSchemaProcessListProcessesByUser bool `yaml:"info_schema_processlist_processes_by_user"` InfoSchemaProcessListProcessesByHost bool `yaml:"info_schema_processlist_processes_by_host"` InfoSchemaTablesDatabases string `yaml:"info_schema_tables_databases"` PerfSchemaEventsStatementsLimit int `yaml:"perf_schema_eventsstatements_limit"` PerfSchemaEventsStatementsTimeLimit int `yaml:"perf_schema_eventsstatements_time_limit"` PerfSchemaEventsStatementsTextLimit int `yaml:"perf_schema_eventsstatements_digtext_text_limit"` PerfSchemaFileInstancesFilter string `yaml:"perf_schema_file_instances_filter"` PerfSchemaFileInstancesRemovePrefix string `yaml:"perf_schema_file_instances_remove_prefix"` HeartbeatDatabase string `yaml:"heartbeat_database"` HeartbeatTable string `yaml:"heartbeat_table"` HeartbeatUTC bool `yaml:"heartbeat_utc"` MySQLUserPrivileges bool `yaml:"mysql_user_privileges"` }
Config controls the mysqld_exporter integration.
var ( DefaultConfig Config = Config{ LockWaitTimeout: 2, InfoSchemaProcessListProcessesByUser: true, InfoSchemaProcessListProcessesByHost: true, InfoSchemaTablesDatabases: "*", PerfSchemaEventsStatementsLimit: 250, PerfSchemaEventsStatementsTimeLimit: 86400, PerfSchemaEventsStatementsTextLimit: 120, PerfSchemaFileInstancesFilter: ".*", PerfSchemaFileInstancesRemovePrefix: "/var/lib/mysql", HeartbeatDatabase: "heartbeat", HeartbeatTable: "heartbeat", } )
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler for Config.
type Integration ¶
type Integration struct {
// contains filtered or unexported fields
}
Integration is the mysqld_exporter integration. The integration scrapes metrics from a mysqld process.
func New ¶
func New(log log.Logger, c Config) (*Integration, error)
New creates a new mysqld_exporter integration.
func (*Integration) CommonConfig ¶
func (i *Integration) CommonConfig() config.Common
CommonConfig satisfies Integration.CommonConfig.
func (*Integration) RegisterRoutes ¶
func (i *Integration) RegisterRoutes(r *mux.Router) error
RegisterRoutes satisfies Integration.RegisterRoutes. The mux.Router provided here is expected to be a subrouter, where all registered paths will be registered within that subroute.
func (*Integration) Run ¶
func (i *Integration) Run(ctx context.Context) error
Run satisfies Integration.Run.
func (*Integration) ScrapeConfigs ¶
func (i *Integration) ScrapeConfigs() []config.ScrapeConfig
ScrapeConfigs satisfies Integration.ScrapeConfigs.