Documentation ¶
Index ¶
Constants ¶
View Source
const ( Discard ColumnUsage = iota // Ignore this column Label // Use this column as a label Counter // Use this column as a counter Gauge // Use this column as a gauge NoVersion PgVersion = -1 )
Column usage types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnUsage ¶
type ColumnUsage int
ColumnUsage describes column usage
func (*ColumnUsage) UnmarshalYAML ¶
func (c *ColumnUsage) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML unmarshals the yaml
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config describes exporter config
type DbConfig ¶
type DbConfig struct { Host string `yaml:"host"` Port uint16 `yaml:"port"` User string `yaml:"user"` Password string `yaml:"password"` Dbname string `yaml:"dbname"` Sslmode string `yaml:"sslmode"` QueryFiles []string `yaml:"queryFiles"` LabelsMap map[string]string `yaml:"labels"` WorkersNumber int `yaml:"workers"` StatementTimeout time.Duration `yaml:"statementTimeout"` IsNotPg bool `yaml:"isNotPg"` // contains filtered or unexported fields }
DbConfig describes database to get metrics from
func (*DbConfig) ApplicationName ¶
func (*DbConfig) InstanceName ¶
InstanceName returns instance name
func (*DbConfig) LoadQueries ¶
LoadQueries loads the queries from the QueryFiles
type DbConfigInterface ¶
type DbConfigInterface interface { Workers() int Queries() []Query InstanceName() string Labels() map[string]string ApplicationName() string }
DbConfigInterface describes DbConfig methods
type Metric ¶
type Metric struct { Usage ColumnUsage `yaml:"usage"` Description string `yaml:"description"` }
Metric describes metric
type Metrics ¶
Metrics describe metrics
func (*Metrics) UnmarshalYAML ¶
UnmarshalYAML unmarshals the yaml
type PgVersion ¶
type PgVersion int
PgVersion describes version in server_version_num format
func ParseVersion ¶
func (*PgVersion) UnmarshalYAML ¶
UnmarshalYAML unmarshals the yaml
type Query ¶
type Query struct { Name string Metrics Metrics `yaml:"metrics"` VerSQL VerSQLs `yaml:"query"` NameColumn string `yaml:"nameColumn"` ValueColumn string `yaml:"valueColumn"` }
Query describes query
Click to show internal directories.
Click to hide internal directories.