Documentation ¶
Overview ¶
Package config provides access to pmm-agent configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Application ¶
Application returns kingpin application that will parse command-line flags and environment variables (but not configuration file) into cfg except --config-file/PMM_AGENT_CONFIG_FILE that is returned separately.
func ConfigureLogger ¶
func ConfigureLogger(cfg *Config)
ConfigureLogger configures standard Logrus logger.
Types ¶
type Config ¶
type Config struct { ID string `yaml:"id"` ListenAddress string `yaml:"listen-address"` ListenPort uint16 `yaml:"listen-port"` Server Server `yaml:"server"` Paths Paths `yaml:"paths"` Ports Ports `yaml:"ports"` Debug bool `yaml:"debug"` Trace bool `yaml:"trace"` Setup Setup `yaml:"-"` }
Config represents pmm-agent's configuration.
func Get ¶
Get parses command-line flags, environment variables and configuration file (if --config-file/PMM_AGENT_CONFIG_FILE is defined). It returns configuration, configuration file path (value of -config-file/PMM_AGENT_CONFIG_FILE, may be empty), and any encountered error. That error may be ErrConfigFileDoesNotExist if configuration file path is not empty, but file itself does not exist. Configuration from command-line flags and environment variables is still returned in this case.
type ErrConfigFileDoesNotExist ¶
type ErrConfigFileDoesNotExist string
ErrConfigFileDoesNotExist error is returned from Get method if configuration file is expected, but does not exist.
func (ErrConfigFileDoesNotExist) Error ¶
func (e ErrConfigFileDoesNotExist) Error() string
type Paths ¶
type Paths struct { ExportersBase string `yaml:"exporters_base"` NodeExporter string `yaml:"node_exporter"` MySQLdExporter string `yaml:"mysqld_exporter"` MongoDBExporter string `yaml:"mongodb_exporter"` PostgresExporter string `yaml:"postgres_exporter"` ProxySQLExporter string `yaml:"proxysql_exporter"` RDSExporter string `yaml:"rds_exporter"` VMAgent string `yaml:"vmagent"` TempDir string `yaml:"tempdir"` PTSummary string `yaml:"pt_summary"` PTPgSummary string `yaml:"pt_pg_summary"` PTMySqlSummary string `yaml:"pt_mysql_summary"` PTMongoDBSummary string `yaml:"pt_mongodb_summary"` SlowLogFilePrefix string `yaml:"slowlog_file_prefix,omitempty"` // for development and testing }
Paths represents binaries paths configuration.
type Server ¶
type Server struct { Address string `yaml:"address"` Username string `yaml:"username"` Password string `yaml:"password"` InsecureTLS bool `yaml:"insecure-tls"` WithoutTLS bool `yaml:"without-tls,omitempty"` // for development and testing }
Server represents PMM Server configuration.
func (*Server) FilteredURL ¶
FilteredURL returns URL with redacted password.
type Setup ¶
type Setup struct { NodeType string NodeName string MachineID string Distro string ContainerID string ContainerName string NodeModel string Region string Az string Address string MetricsMode string DisableCollectors string Force bool SkipRegistration bool }
Setup contains `pmm-agent setup` flag and argument values. It is never stored in configuration file.