elasticsearch_exporter

package
v1.2.0-rc.1 Latest Latest
Warning

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

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

Documentation

Overview

Package elasticsearch_exporter instantiates the exporter from github.com/justwatchcom/elasticsearch_exporter - replaced for github.com/prometheus-community/elasticsearch_exporter Using the YAML config provided by the agent

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Address:                   "http://localhost:9200",
	Timeout:                   5 * time.Second,
	Node:                      "_local",
	ExportClusterInfoInterval: 5 * time.Minute,
	IncludeAliases:            true,
}

DefaultConfig holds the default settings for the elasticsearch_exporter integration.

Functions

func New

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

New creates a new elasticsearch_exporter This function replicates the main() function of github.com/justwatchcom/elasticsearch_exporter but uses yaml configuration instead of kingpin flags.

Types

type BasicAuthHTTPTransport

type BasicAuthHTTPTransport struct {
	http.Transport
	// contains filtered or unexported fields
}

Custom http.Transport struct for Basic Auth-secured communication with ES cluster

func (*BasicAuthHTTPTransport) RoundTrip

func (b *BasicAuthHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Config

type Config struct {
	// HTTP API address of an Elasticsearch node.
	Address string `yaml:"address,omitempty"`
	// Timeout for trying to get stats from Elasticsearch.
	Timeout time.Duration `yaml:"timeout,omitempty"`
	// Export stats for all nodes in the cluster. If used, this flag will override the flag es.node.
	AllNodes bool `yaml:"all,omitempty"`
	// Node's name of which metrics should be exposed.
	Node string `yaml:"node,omitempty"`
	// Export stats for indices in the cluster.
	ExportIndices bool `yaml:"indices,omitempty"`
	// Export stats for settings of all indices of the cluster.
	ExportIndicesSettings bool `yaml:"indices_settings,omitempty"`
	// Export stats for cluster settings.
	ExportClusterSettings bool `yaml:"cluster_settings,omitempty"`
	// Export stats for shards in the cluster (implies indices).
	ExportShards bool `yaml:"shards,omitempty"`
	// Include informational aliases metrics
	IncludeAliases bool `yaml:"aliases,omitempty"`
	// Export stats for the cluster snapshots.
	ExportSnapshots bool `yaml:"snapshots,omitempty"`
	// Cluster info update interval for the cluster label.
	ExportClusterInfoInterval time.Duration `yaml:"clusterinfo_interval,omitempty"`
	// Path to PEM file that contains trusted Certificate Authorities for the Elasticsearch connection.
	CA string `yaml:"ca,omitempty"`
	// Path to PEM file that contains the private key for client auth when connecting to Elasticsearch.
	ClientPrivateKey string `yaml:"client_private_key,omitempty"`
	// Path to PEM file that contains the corresponding cert for the private key to connect to Elasticsearch.
	ClientCert string `yaml:"client_cert,omitempty"`
	// Skip SSL verification when connecting to Elasticsearch.
	InsecureSkipVerify bool `yaml:"ssl_skip_verify,omitempty"`
	// Export stats for Data Streams
	ExportDataStreams bool `yaml:"data_stream,omitempty"`
	// Export stats for Snapshot Lifecycle Management
	ExportSLM bool `yaml:"slm,omitempty"`
	// BasicAuth block allows secure connection with Elasticsearch cluster via Basic-Auth
	BasicAuth *promCfg.BasicAuth `yaml:"basic_auth,omitempty"`
}

Config controls the elasticsearch_exporter integration.

func (*Config) InstanceKey

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

InstanceKey returns the hostname:port of the elasticsearch node being queried.

func (*Config) Name

func (c *Config) Name() string

Name returns the name of the integration that this config represents.

func (*Config) NewIntegration

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

NewIntegration creates a new elasticsearch_exporter

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler for Config

Jump to

Keyboard shortcuts

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