pgscv

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Overview

Package pgscv is a pgSCV main helper

Package pgscv is a pgSCV main helper

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RealPath

func RealPath(filePath string) (string, error)

RealPath read real config file path

func Start

func Start(ctx context.Context, config *Config) error

Start is the application's starting point.

Types

type Config

type Config struct {
	NoTrackMode                  bool                     `yaml:"no_track_mode"`      // controls tracking sensitive information (query texts, etc)
	ListenAddress                string                   `yaml:"listen_address"`     // Network address and port where the application should listen on
	ServicesConnsSettings        service.ConnsSettings    `yaml:"services"`           // All connections settings for exact services
	Defaults                     map[string]string        `yaml:"defaults"`           // Defaults
	DisableCollectors            []string                 `yaml:"disable_collectors"` // List of collectors which should be disabled. DEPRECATED in favor collectors settings
	CollectorsSettings           model.CollectorsSettings `yaml:"collectors"`         // Collectors settings propagated from main YAML configuration
	Databases                    string                   `yaml:"databases"`          // Regular expression string specifies databases from which metrics should be collected
	DatabasesRE                  *regexp.Regexp           // Regular expression object compiled from Databases
	AuthConfig                   http.AuthConfig          `yaml:"authentication"`       // TLS and Basic auth configuration
	CollectTopTable              int                      `yaml:"collect_top_table"`    // Limit elements on Table collector
	CollectTopIndex              int                      `yaml:"collect_top_index"`    // Limit elements on Indexes collector
	CollectTopQuery              int                      `yaml:"collect_top_query"`    // Limit elements on Statements collector
	SkipConnErrorMode            bool                     `yaml:"skip_conn_error_mode"` // Skipping connection errors and creating a Service instance.
	DiscoveryConfig              *any                     `yaml:"discovery"`
	DiscoveryServices            *map[string]sd.Discovery
	ConnTimeout                  int           `yaml:"conn_timeout"`
	URLPrefix                    string        `yaml:"url_prefix"` // Url prefix
	ThrottlingInterval           *int          `yaml:"throttling_interval"`
	ConcurrencyLimit             *int          `yaml:"concurrency_limit"`
	RefreshServiceConfigInterval time.Duration `yaml:"refresh_service_config_interval"`
}

Config defines application's configuration.

func NewConfig

func NewConfig(configFilePath string) (*Config, error)

NewConfig creates new config based on config file or return default config if config file is not specified.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks configuration for stupid values and set defaults

Jump to

Keyboard shortcuts

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