elasticsearchreceiver

package module
v0.99.0 Latest Latest
Warning

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

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

README

Elasticsearch Receiver

Status
Stability beta: metrics
Distributions contrib
Issues Open issues Closed issues
Code Owners @djaglowski, @BinaryFissionGames | Seeking more code owners!

This receiver queries the Elasticsearch node stats, cluster health and index stats endpoints in order to scrape metrics from a running elasticsearch cluster.

Prerequisites

This receiver supports Elasticsearch versions 7.9+

If Elasticsearch security features are enabled, you must have either the monitor or manage cluster privilege. See the Elasticsearch docs for more information on authorization and Security privileges.

Configuration

The following settings are optional:

  • metrics (default: see DefaultMetricsSettings here: Allows enabling and disabling specific metrics from being collected in this receiver.
  • nodes (default: ["_all"]): Allows specifying node filters that define which nodes are scraped for node-level and cluster-level metrics. See the Elasticsearch documentation for allowed filters. If this option is left explicitly empty, then no node-level metrics will be scraped and cluster-level metrics will scrape only metrics related to cluster's health.
  • skip_cluster_metrics (default: false): If true, cluster-level metrics will not be scraped.
  • indices (default: ["_all"]): Allows specifying index filters that define which indices are scraped for index-level metrics. See the Elasticsearch documentation for allowed filters. If this option is left explicitly empty, then no index-level metrics will be scraped.
  • endpoint (default = http://localhost:9200): The base URL of the Elasticsearch API for the cluster to monitor.
  • username (no default): Specifies the username used to authenticate with Elasticsearch using basic auth. Must be specified if password is specified.
  • password (no default): Specifies the password used to authenticate with Elasticsearch using basic auth. Must be specified if username is specified.
  • collection_interval (default = 10s): This receiver collects metrics on an interval. This value must be a string readable by Golang's time.ParseDuration. On larger clusters, the interval may need to be lengthened, as querying Elasticsearch for metrics will take longer on clusters with more nodes.
  • initial_delay (default = 1s): defines how long this receiver waits before starting.
Example Configuration
receivers:
  elasticsearch:
    metrics:
      elasticsearch.node.fs.disk.available:
        enabled: false
    nodes: ["_local"]
    skip_cluster_metrics: true
    indices: [".geoip_databases"]
    endpoint: http://localhost:9200
    username: otel
    password: password
    collection_interval: 10s

The full list of settings exposed for this receiver are documented here with detailed sample configurations here.

Metrics

The following metric are available with versions:

  • elasticsearch.indexing_pressure.memory.limit >= 7.10
  • elasticsearch.node.shards.data_set.size >= 7.13
  • elasticsearch.cluster.state_update.count >= 7.16.0
  • elasticsearch.cluster.state_update.time >= 7.16.0

Details about the metrics produced by this receiver can be found in metadata.yaml

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a factory for elasticsearch receiver.

Types

type Config

type Config struct {
	scraperhelper.ControllerConfig `mapstructure:",squash"`
	confighttp.ClientConfig        `mapstructure:",squash"`
	// MetricsBuilderConfig defines which metrics/attributes to enable for the scraper
	metadata.MetricsBuilderConfig `mapstructure:",squash"`
	// Nodes defines the nodes to scrape.
	// See https://www.elastic.co/guide/en/elasticsearch/reference/7.9/cluster.html#cluster-nodes for which selectors may be used here.
	// If Nodes is empty, no nodes will be scraped.
	Nodes []string `mapstructure:"nodes"`
	// SkipClusterMetrics indicates whether cluster level metrics from /_cluster/* endpoints should be scraped or not.
	SkipClusterMetrics bool `mapstructure:"skip_cluster_metrics"`
	// Indices defines the indices to scrape.
	// See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html#index-stats-api-path-params
	// for which names are viable.
	// If Indices is empty, no indices will be scraped.
	Indices []string `mapstructure:"indices"`
	// Username is the username used when making REST calls to elasticsearch. Must be specified if Password is. Not required.
	Username string `mapstructure:"username"`
	// Password is the password used when making REST calls to elasticsearch. Must be specified if Username is. Not required.
	Password configopaque.String `mapstructure:"password"`
}

Config is the configuration for the elasticsearch receiver

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the given config, returning an error specifying any issues with the config.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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