config

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultExporterLockWaitTimeoutSeconds = 2
	DefaultEnableExporterLockTimeout      = true
	DefaultSlowLogFilter                  = false
	DefaultExporterQueryTimeout           = 0
	DefaultExporterMaxOpenConns           = 2

	DefaultHeartbeatDatabase = "heartbeat"
	DefaultHeartbeatTable    = "heartbeat"
	DefaultHeartbeatUTC      = false

	DefaultInfoSchemaProcesslistMinTime         = 0
	DefaultInfoSchemaProcesslistProcessesByUser = true
	DefaultInfoSchemaProcesslistProcessesByHost = true

	DefaultInfoSchemaTablesDatabases = "*"

	DefaultPerfSchemaEventsStatementsLimit           = 250
	DefaultPerfSchemaEventsStatementsTimeLimit       = 86400
	DefaultPerfSchemaEventsStatementsDigestTextLimit = 120

	DefaultPerfSchemaFileInstancesFilter       = ".*"
	DefaultPerfSchemaFileInstancesRemovePrefix = "/var/lib/mysql/"
	DefaultPerfSchemaMemoryEventsRemovePrefix  = "memory/"

	DefaultMysqlUserPrivileges = false
)

Variables

This section is empty.

Functions

func DefaultCollectorConfig added in v0.21.0

func DefaultCollectorConfig() map[string]bool

Types

type AuthConfig added in v0.21.0

type AuthConfig struct {
	Sections map[string]MySqlConfig
}

type AuthConfigHandler added in v0.21.0

type AuthConfigHandler struct {
	sync.RWMutex
	TlsInsecureSkipVerify bool
	Config                *AuthConfig
	// contains filtered or unexported fields
}

func NewAuthConfigHandler added in v0.21.0

func NewAuthConfigHandler(registerer prometheus.Registerer) (*AuthConfigHandler, error)

func (*AuthConfigHandler) GetConfig added in v0.21.0

func (ch *AuthConfigHandler) GetConfig() *AuthConfig

func (*AuthConfigHandler) ReloadConfig added in v0.21.0

func (ch *AuthConfigHandler) ReloadConfig(filename string, mysqldAddress string, mysqldUser string, tlsInsecureSkipVerify bool, logger *slog.Logger) (err error)

type Config

type Config struct {
	DataSourceName                 string
	Collectors                     map[string]bool
	EnableExporterLockWaitTimeout  bool
	ExporterLockWaitTimeoutSeconds int
	SlowLogFilter                  bool
	ExporterQueryTimeout           time.Duration
	ExporterMaxOpenConns           int
	Heartbeat                      HeartbeatConfig
	InfoSchemaProcesslist          InfoSchemaProcesslistConfig
	InfoSchemaTables               InfoSchemaTablesConfig
	PerfSchemaEventsStatements     PerfSchemaEventsStatementsConfig
	PerfSchemaFileInstances        PerfSchemaFileInstancesConfig
	PerfSchemaMemoryEvents         PerfSchemaMemoryEventsConfig
	MysqlUser                      MysqlUserConfig
}

func NewConfigWithDefaults added in v0.21.0

func NewConfigWithDefaults() Config

func (Config) Validate added in v0.21.0

func (c Config) Validate() error

type EmptyConfig added in v0.21.0

type EmptyConfig struct{}

type HeartbeatConfig added in v0.21.0

type HeartbeatConfig struct {
	Database string
	Table    string
	UTC      bool
}

type InfoSchemaProcesslistConfig added in v0.21.0

type InfoSchemaProcesslistConfig struct {
	MinTime         int
	ProcessesByUser bool
	ProcessesByHost bool
}

type InfoSchemaTablesConfig added in v0.21.0

type InfoSchemaTablesConfig struct {
	Databases string
}

type MySqlConfig

type MySqlConfig struct {
	User                  string `ini:"user"`
	Password              string `ini:"password"`
	Host                  string `ini:"host"`
	Port                  int    `ini:"port"`
	Socket                string `ini:"socket"`
	EnableCleartextPlugin bool   `ini:"enable-cleartext-plugin"`
	SslCa                 string `ini:"ssl-ca"`
	SslCert               string `ini:"ssl-cert"`
	SslKey                string `ini:"ssl-key"`
	TlsInsecureSkipVerify bool   `ini:"ssl-skip-verfication"` //nolint:misspell
	Tls                   string `ini:"tls"`
	TlsMinVersion         string `ini:"tls-min-version"`
	TlsMaxVersion         string `ini:"tls-max-version"`
	TlsServerName         string `ini:"tls-server-name"`
}

func (MySqlConfig) CustomizeTLS

func (m MySqlConfig) CustomizeTLS(configSectionName string) error

func (MySqlConfig) FormDSN

func (m MySqlConfig) FormDSN(target string, configSectionName string) (string, error)

type MySqlConfigHandler

type MySqlConfigHandler = AuthConfigHandler

type MysqlUserConfig added in v0.21.0

type MysqlUserConfig struct {
	Privileges bool
}

type PerfSchemaEventsStatementsConfig added in v0.21.0

type PerfSchemaEventsStatementsConfig struct {
	Limit           int
	TimeLimit       int
	DigestTextLimit int
	ExcludeSchemas  []string
}

type PerfSchemaFileInstancesConfig added in v0.21.0

type PerfSchemaFileInstancesConfig struct {
	Filter       string
	RemovePrefix string
}

type PerfSchemaMemoryEventsConfig added in v0.21.0

type PerfSchemaMemoryEventsConfig struct {
	RemovePrefix string
}

Jump to

Keyboard shortcuts

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