mysql

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseDir string             `toml:"-"`
	Global  *Global            `toml:"global"`
	Queries []sqlc.CustomQuery `toml:"queries"`

	CollectGlobalStatus struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_global_status"`
	CollectGlobalVariables struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_global_variables"`
	CollectSlaveStatus struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_slave_status"`
	CollectInfoSchemaInnodbCmp struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_innodb_cmp"`
	CollectInfoSchemaInnodbCmpmem struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_innodb_cmpmem"`
	CollectInfoSchemaQueryResponseTime struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_query_response_time"`
	CollectInfoSchemaProcesslist struct {
		Enabled         bool `toml:"enabled"`
		MinTime         int  `toml:"min_time"`
		ProcessesByUser bool `toml:"processes_by_user"`
		ProcessesByHost bool `toml:"processes_by_host"`
	} `toml:"collect_info_schema_processlist"`
	CollectInfoSchemaTables struct {
		Enabled   bool   `toml:"enabled"`
		Databases string `toml:"databases"`
	} `toml:"collect_info_schema_tables"`
	CollectInfoSchemaInnodbTablespaces struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_innodb_tablespaces"`
	CollectInfoSchemaInnodbMetrics struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_innodb_metrics"`
	CollectInfoSchemaUserstats struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_userstats"`
	CollectInfoSchemaClientstats struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_clientstats"`
	CollectInfoSchemaTablestats struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_tablestats"`
	CollectInfoSchemaSchemastats struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_schemastats"`
	CollectInfoSchemaReplicaHost struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_info_schema_replica_host"`
	CollectMysqlUser struct {
		Enabled               bool `toml:"enabled"`
		CollectUserPrivileges bool `toml:"collect_user_privileges"`
	} `toml:"collect_mysql_user"`
	CollectAutoIncrementColumns struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_auto_increment_columns"`
	CollectBinlogSize struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_binlog_size"`
	CollectPerfSchemaTableiowaits struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_tableiowaits"`
	CollectPerfSchemaIndexiowaits struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_indexiowaits"`
	CollectPerfSchemaTablelocks struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_tablelocks"`
	CollectPerfSchemaEventsstatements struct {
		Enabled         bool `toml:"enabled"`
		Limit           int  `toml:"limit"`
		Timelimit       int  `toml:"timelimit"`
		DigestTextLimit int  `toml:"digest_text_limit"`
	} `toml:"collect_perf_schema_eventsstatements"`
	CollectPerfSchemaEventsstatementssum struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_eventsstatementssum"`
	CollectPerfSchemaEventswaits struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_eventswaits"`
	CollectPerfSchemaFileEvents struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_file_events"`
	CollectPerfSchemaFileInstances struct {
		Enabled      bool   `toml:"enabled"`
		Filter       string `toml:"filter"`
		RemovePrefix string `toml:"remove_prefix"`
	} `toml:"collect_perf_schema_file_instances"`
	CollectPerfSchemaMemoryEvents struct {
		Enabled      bool   `toml:"enabled"`
		RemovePrefix string `toml:"remove_prefix"`
	} `toml:"collect_perf_schema_memory_events"`
	CollectPerfSchemaReplicationGroupMembers struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_replication_group_members"`
	CollectPerfSchemaReplicationGroupMemberStats struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_replication_group_member_stats"`
	CollectPerfSchemaReplicationApplierStatusByWorker struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_perf_schema_replication_applier_status_by_worker"`
	CollectSysUserSummary struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_sys_user_summary"`
	CollectEngineTokudbStatus struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_engine_tokudb_status"`
	CollectEngineInnodbStatus struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_engine_innodb_status"`
	CollectHeartbeat struct {
		Enabled  bool   `toml:"enabled"`
		Database string `toml:"database"`
		Table    string `toml:"table"`
		UTC      bool   `toml:"utc"`
	} `toml:"collect_heartbeat"`
	CollectSlaveHosts struct {
		Enabled bool `toml:"enabled"`
	} `toml:"collect_slave_hosts"`
}

func (*Config) EnabledScrapers

func (c *Config) EnabledScrapers() (ret []collector.Scraper)

type Global

type Global struct {
	User                  string   `toml:"user"`
	Password              string   `toml:"password"`
	SslCa                 string   `toml:"ssl_ca"`
	SslCert               string   `toml:"ssl_cert"`
	SslKey                string   `toml:"ssl_key"`
	TlsInsecureSkipVerify bool     `toml:"ssl_skip_verfication"`
	Tls                   string   `toml:"tls"`
	ScraperEnabled        []string `toml:"scraper_enabled"`
	LockWaitTimeout       int      `toml:"lock_wait_timeout"`
	LogSlowFilter         bool     `toml:"log_slow_filter"`
}

func (Global) CustomizeTLS

func (g Global) CustomizeTLS() error

func (Global) FormDSN

func (g Global) FormDSN(target string) (string, error)

type MySQL

type MySQL struct {
}

func (*MySQL) ParseConfig

func (*MySQL) ParseConfig(baseDir string, bs []byte) (any, error)

func (*MySQL) Scrape

func (*MySQL) Scrape(ctx context.Context, address string, c any, ss *types.Samples) error

mysqld_exporter 原来的很多参数都是通过命令行传的,在 cprobe 的场景下,需要改造 cprobe 是并发抓取很多个数据库实例的监控数据,不同的数据库实例其抓取参数可能不同 如果直接修改 collector pkg 下面的变量,就会有并发使用变量的问题 把这些自定义参数封装到一个一个的 collector.Scraper 对象中,每个 target 抓取时实例化这些 collector.Scraper 对象

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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