Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Service label string for system service ServiceTypeSystem = "system" // Service label string for Postgres services ServiceTypePostgresql = "postgres" // Service label string for Pgbouncer services ServiceTypePgbouncer = "pgbouncer" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectorSettings ¶ added in v0.4.23
type CollectorSettings struct {
// Subsystems defines subsystem with user-defined metrics.
Subsystems Subsystems `yaml:"subsystems"`
}
CollectorSettings unions all settings related to a single collector.
type CollectorsSettings ¶ added in v0.4.23
type CollectorsSettings map[string]CollectorSettings
CollectorsSettings unions all collectors settings in one place.
type Metrics ¶ added in v0.4.23
type Metrics []UserMetric
Metrics unions all metrics in one place. type Metrics map[string]UserMetric
type MetricsSubsystem ¶ added in v0.4.23
type MetricsSubsystem struct {
// TODO: this should be an interface because use cases are not limited by queries only,
// there could by system commands, HTTP requests, etc...
// Databases defines which databases should be visited for collecting metrics.
Databases string `yaml:"databases"`
DatabasesRE *regexp.Regexp
// Query defines a SQL statement used for getting label/values for metrics.
Query string `yaml:"query"`
// Metrics defines a list of labels and metrics should be extracted from Query result.
Metrics Metrics `yaml:"metrics"`
}
MetricsSubsystem describes a single subsystem.
type PGResult ¶
type PGResult struct {
Nrows int
Ncols int
Colnames []pgproto3.FieldDescription
Rows [][]sql.NullString
}
PGResult is the iterable store that contains query result (data and metadata) returned from Postgres
type Subsystems ¶ added in v0.4.23
type Subsystems map[string]MetricsSubsystem
Subsystems unions all subsystems in one place.
type UserMetric ¶ added in v0.4.23
type UserMetric struct {
ShortName string `yaml:"name"`
Usage string `yaml:"usage"`
Labels []string `yaml:"labels,omitempty"`
Value string `yaml:"value"`
LabeledValues map[string][]string `yaml:"labeled_values,omitempty"`
Description string `yaml:"description"`
}
UserMetric defines a single metric and its properties.
Click to show internal directories.
Click to hide internal directories.