config

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BASE_CLOUD_METADATA_URL = "http://169.254.169.254/"
	HTTP_DEFAULT_TIMEOUT    = time.Duration(1 * time.Second)
)

Variables

This section is empty.

Functions

func CollectCloudDetails

func CollectCloudDetails() map[string]string

func InitConfig

func InitConfig(configFile string)

Initialize exporter configuration

func InitGaugeStats

func InitGaugeStats(pGaugeStatsFile string)

Initialize exporter configuration

Types

type Config

type Config struct {
	Agent struct {
		OtelEnabled       bool `toml:"enable_open_telemetry"`
		PrometheusEnabled bool `toml:"enable_prometheus"`

		MetricLabels map[string]string `toml:"labels"`

		Timeout uint8 `toml:"timeout"`

		RefreshSystemStats bool   `toml:"refresh_system_stats"`
		CloudProvider      string `toml:"cloud_provider"`

		LogFile           string `toml:"log_file"`
		LogLevel          string `toml:"log_level"`
		UseMockDatasource bool   `toml:"use_mock_datasource"`

		Bind              string `toml:"bind"`
		CertFile          string `toml:"cert_file"`
		KeyFile           string `toml:"key_file"`
		RootCA            string `toml:"root_ca"`
		KeyFilePassphrase string `toml:"key_file_passphrase"`

		BasicAuthUsername string `toml:"basic_auth_username"`
		BasicAuthPassword string `toml:"basic_auth_password"`

		Otel struct {
			OtelServiceName             string            `toml:"service_name"`
			OtelEndpoint                string            `toml:"endpoint"`
			OtelTlsEnabled              bool              `toml:"endpoint_tls_enabled"`
			OtelHeaders                 map[string]string `toml:"headers"`
			OtelPushInterval            uint8             `toml:"push_interval"`
			OtelServerStatFetchInterval uint8             `toml:"server_stat_fetch_interval"`
		} `toml:"OpenTelemetry"`

		IsKubernetes      bool
		KubernetesPodName string
	} `toml:"Agent"`

	Aerospike struct {
		Host string `toml:"db_host"`
		Port uint16 `toml:"db_port"`

		CertFile          string `toml:"cert_file"`
		KeyFile           string `toml:"key_file"`
		KeyFilePassphrase string `toml:"key_file_passphrase"`
		NodeTLSName       string `toml:"node_tls_name"`
		RootCA            string `toml:"root_ca"`

		AuthMode string `toml:"auth_mode"`
		User     string `toml:"user"`
		Password string `toml:"password"`

		Timeout uint8 `toml:"timeout"`

		LatencyBucketsCount uint8 `toml:"latency_buckets_count"`

		// Order of context ( from observer.go) - namespace, set, latencies, node-stats, xdr, user, jobs, sindex
		// Namespace metrics allow/block
		NamespaceMetricsAllowlist []string `toml:"namespace_metrics_allowlist"`
		NamespaceMetricsBlocklist []string `toml:"namespace_metrics_blocklist"`

		NamespaceMetricsAllowlistEnabled bool

		// Set metrics allow/block
		SetMetricsAllowlist []string `toml:"set_metrics_allowlist"`
		SetMetricsBlocklist []string `toml:"set_metrics_blocklist"`

		SetMetricsAllowlistEnabled bool

		// Latencies metrics allow/block
		LatenciesMetricsAllowlist []string `toml:"latencies_metrics_allowlist"`
		LatenciesMetricsBlocklist []string `toml:"latencies_metrics_blocklist"`

		LatenciesMetricsAllowlistEnabled bool

		// knob to disable latencies metrics collection (for internal use only, will be deprecated)
		DisableLatenciesMetrics bool `toml:"disable_latencies_metrics"`

		// Node metrics allow/block
		NodeMetricsAllowlist []string `toml:"node_metrics_allowlist"`
		NodeMetricsBlocklist []string `toml:"node_metrics_blocklist"`

		NodeMetricsAllowlistEnabled bool

		// Xdr metrics allow/block
		XdrMetricsAllowlist []string `toml:"xdr_metrics_allowlist"`
		XdrMetricsBlocklist []string `toml:"xdr_metrics_blocklist"`

		XdrMetricsAllowlistEnabled bool

		// User metrics allow/block
		UserMetricsUsersAllowlist []string `toml:"user_metrics_users_allowlist"`
		UserMetricsUsersBlocklist []string `toml:"user_metrics_users_blocklist"`

		UserMetricsUsersAllowlistEnabled bool

		// Job metrics allow/block
		JobMetricsAllowlist []string `toml:"job_metrics_allowlist"`
		JobMetricsBlocklist []string `toml:"job_metrics_blocklist"`

		JobMetricsAllowlistEnabled bool

		// knob to disable job metrics collection (for internal use only, will be deprecated)
		DisableJobMetrics bool `toml:"disable_job_metrics"`

		// Sindex metrics allow/block
		SindexMetricsAllowlist []string `toml:"sindex_metrics_allowlist"`
		SindexMetricsBlocklist []string `toml:"sindex_metrics_blocklist"`

		SindexMetricsAllowlistEnabled bool

		// knob to disable sindex metrics collection (for internal use only, will be deprecated)
		DisableSindexMetrics bool `toml:"disable_sindex_metrics"`

		// Tolerate older whitelist and blacklist configurations for a while
		NamespaceMetricsWhitelist []string `toml:"namespace_metrics_whitelist"`
		SetMetricsWhitelist       []string `toml:"set_metrics_whitelist"`
		NodeMetricsWhitelist      []string `toml:"node_metrics_whitelist"`
		XdrMetricsWhitelist       []string `toml:"xdr_metrics_whitelist"`

		NamespaceMetricsBlacklist []string `toml:"namespace_metrics_blacklist"`
		SetMetricsBlacklist       []string `toml:"set_metrics_blacklist"`
		NodeMetricsBlacklist      []string `toml:"node_metrics_blacklist"`
		XdrMetricsBlacklist       []string `toml:"xdr_metrics_blacklist"`
	} `toml:"Aerospike"`

	LogFile *os.File
}

Config represents the aerospike-prometheus-exporter configuration

var Cfg Config

func (*Config) FetchCloudInfo

func (c *Config) FetchCloudInfo(md toml.MetaData)

func (*Config) FetchKubernetesInfo added in v1.17.0

func (c *Config) FetchKubernetesInfo(md toml.MetaData)

func (*Config) ValidateAndUpdate

func (c *Config) ValidateAndUpdate(md toml.MetaData)

Validate and update exporter configuration

type GaugeStats

type GaugeStats struct {

	// used to read from toml config file, these array will be emptied once read and stats are mapped to a file
	Namespace []string `toml:"namespace_gauge_stats"`
	Node      []string `toml:"node_gauge_stats"`
	Sets      []string `toml:"sets_gauge_stats"`
	Sindex    []string `toml:"sindex_gauge_stats"`
	Xdr       []string `toml:"xdr_gauge_stats"`

	// System Info Gauges
	SysInfo []string `toml:"system_info_gauge_stats"`

	// why below maps?
	// all gauge stats are added and mapped as true after reading from toml file
	NamespaceStats map[string]bool
	NodeStats      map[string]bool
	SetsStats      map[string]bool
	SindexStats    map[string]bool
	XdrStats       map[string]bool

	// System Info Gauges
	SysInfoStats map[string]bool
}

*

  • Defines the structure which holds various Gauge stats for each contexts from a toml file
var GaugeStatHandler GaugeStats

Jump to

Keyboard shortcuts

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