postgres_exporter

package
v1.4.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package postgres_exporter embeds https://github.com/prometheus/postgres_exporter

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(log log.Logger, cfg *Config) (integrations.Integration, error)

New creates a new postgres_exporter integration. The integration scrapes metrics from a postgres process.

Types

type Config

type Config struct {
	// DataSourceNames to use to connect to Postgres.
	DataSourceNames []config_util.Secret `yaml:"data_source_names,omitempty"`

	DisableSettingsMetrics bool     `yaml:"disable_settings_metrics,omitempty"`
	AutodiscoverDatabases  bool     `yaml:"autodiscover_databases,omitempty"`
	ExcludeDatabases       []string `yaml:"exclude_databases,omitempty"`
	IncludeDatabases       []string `yaml:"include_databases,omitempty"`
	DisableDefaultMetrics  bool     `yaml:"disable_default_metrics,omitempty"`
	QueryPath              string   `yaml:"query_path,omitempty"`

	// Instance is used by Alloy to specify the instance name manually. This is
	// only used when there are multiple DSNs provided.
	Instance string
	// EnabledCollectors is a list of additional collectors to enable. NOTE: Due to limitations of the postgres_exporter,
	// this is only used for the first DSN provided and only some collectors can be enabled/disabled this way. See the
	// user-facing docs for more information.
	EnabledCollectors []string
}

Config controls the postgres_exporter integration.

func (*Config) InstanceKey

func (c *Config) InstanceKey(_ string) (string, error)

InstanceKey returns a simplified DSN of the first postgresql DSN, or an error if not exactly one DSN is provided.

func (*Config) Name

func (c *Config) Name() string

Name returns the name of the integration this config is for.

func (*Config) NewIntegration

func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error)

NewIntegration converts this config into an instance of a configuration.

Jump to

Keyboard shortcuts

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