mysqld_exporter

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

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",

	HeartbeatDatabase: "heartbeat",
	HeartbeatTable:    "heartbeat",
}

DefaultConfig holds the default settings for the mysqld_exporter integration.

Functions

func GetScrapers

func GetScrapers(c *Config) []collector.Scraper

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

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"`
	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 added in v0.21.0

func (c *Config) InstanceKey(_ string) (string, error)

InstanceKey returns network(hostname:port)/dbname of the MySQL server.

func (*Config) Name added in v0.10.0

func (c *Config) Name() string

Name returns the name of the integration that this config represents.

func (*Config) NewIntegration added in v0.10.0

func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error)

NewIntegration converts this config into an instance of an integration.

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler for Config.

Jump to

Keyboard shortcuts

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