opensearchexporter

package
v0.0.0-...-0b0bd86 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationSettings

type AuthenticationSettings struct {
	// User is used to configure HTTP Basic Authentication.
	User string `mapstructure:"user"`

	// Password is used to configure HTTP Basic Authentication.
	Password string `mapstructure:"password"`

	// APIKey is used to configure ApiKey based Authentication.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html
	APIKey string `mapstructure:"api_key"`
}

AuthenticationSettings defines user authentication related settings.

type Config

type Config struct {
	exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
	exporterhelper.QueueSettings   `mapstructure:"sending_queue"`
	exporterhelper.RetrySettings   `mapstructure:"retry_on_failure"`

	// Endpoints holds the Elasticsearch URLs the exporter should send events to.
	//
	// This setting is required if CloudID is not set and if the
	// ELASTICSEARCH_URL environment variable is not set.
	Endpoints []string `mapstructure:"endpoints"`

	// VTEX Evidence index Open Search cluster endpoint
	EvidenceEndpoints []string `mapstructure:"evidence_endpoints"`

	// CloudID holds the cloud ID to identify the Elastic Cloud cluster to send events to.
	// https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html
	//
	// This setting is required if no URL is configured.
	CloudID string `mapstructure:"cloudid"`

	// NumWorkers configures the number of workers publishing bulk requests.
	NumWorkers int `mapstructure:"num_workers"`

	// Index configures the index, index alias, or data stream name events should be indexed in.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/indices.html
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html
	//
	// This setting is required.
	Index string `mapstructure:"index"`

	// Pipeline configures the ingest node pipeline name that should be used to process the
	// events.
	//
	// https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html
	Pipeline string `mapstructure:"pipeline"`

	HTTPClientSettings `mapstructure:",squash"`
	Discovery          DiscoverySettings `mapstructure:"discover"`
	Retry              RetrySettings     `mapstructure:"retry"`
	Flush              FlushSettings     `mapstructure:"flush"`
	Mapping            MappingsSettings  `mapstructure:"mapping"`
	WAL                WALSettings       `mapstructure:"wal"`
}

Config defines configuration for Elastic exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the elasticsearch server configuration.

type DiscoverySettings

type DiscoverySettings struct {
	// OnStart, if set, instructs the exporter to look for available Elasticsearch
	// nodes the first time the exporter connects to the cluster.
	OnStart bool `mapstructure:"on_start"`

	// Interval instructs the exporter to renew the list of Elasticsearch URLs
	// with the given interval. URLs will not be updated if Interval is <=0.
	Interval time.Duration `mapstructure:"interval"`
}

DiscoverySettings defines Elasticsearch node discovery related settings. The exporter will check Elasticsearch regularly for available nodes and updates the list of hosts if discovery is enabled. Newly discovered nodes will automatically be used for load balancing.

DiscoverySettings should not be enabled when operating Elasticsearch behind a proxy or load balancer.

https://www.elastic.co/blog/elasticsearch-sniffing-best-practices-what-when-why-how

type FlushSettings

type FlushSettings struct {
	// Bytes sets the send buffer flushing limit.
	Bytes int `mapstructure:"bytes"`

	// Interval configures the max age of a document in the send buffer.
	Interval time.Duration `mapstructure:"interval"`
}

FlushSettings defines settings for configuring the write buffer flushing policy in the Elasticsearch exporter. The exporter sends a bulk request with all events already serialized into the send-buffer.

type HTTPClientSettings

type HTTPClientSettings struct {
	Authentication AuthenticationSettings `mapstructure:",squash"`

	// ReadBufferSize for HTTP client. See http.Transport.ReadBufferSize.
	ReadBufferSize int `mapstructure:"read_buffer_size"`

	// WriteBufferSize for HTTP client. See http.Transport.WriteBufferSize.
	WriteBufferSize int `mapstructure:"write_buffer_size"`

	// Headers allows users to configure optional HTTP headers that
	// will be send with each HTTP request.
	Headers map[string]string `mapstructure:"headers,omitempty"`

	configtls.TLSClientSetting `mapstructure:"tls,omitempty"`
}

type MappingMode

type MappingMode int
const (
	MappingNone MappingMode = iota
	MappingECS
)

Enum values for MappingMode.

func (MappingMode) String

func (m MappingMode) String() string

type MappingsSettings

type MappingsSettings struct {
	// Mode configures the field mappings.
	Mode string `mapstructure:"mode"`

	// Additional field mappings.
	Fields map[string]string `mapstructure:"fields"`

	// File to read additional fields mappings from.
	File string `mapstructure:"file"`

	// Try to find and remove duplicate fields
	Dedup bool `mapstructure:"dedup"`

	Dedot bool `mapstructure:"dedot"`
}

type RetrySettings

type RetrySettings struct {
	// Enabled allows users to disable retry without having to comment out all settings.
	Enabled bool `mapstructure:"enabled"`

	// MaxRequests configures how often an HTTP request is retried before it is assumed to be failed.
	MaxRequests int `mapstructure:"max_requests"`

	// InitialInterval configures the initial waiting time if a request failed.
	InitialInterval time.Duration `mapstructure:"initial_interval"`

	// MaxInterval configures the max waiting time if consecutive requests failed.
	MaxInterval time.Duration `mapstructure:"max_interval"`
}

RetrySettings defines settings for the HTTP request retries in the Elasticsearch exporter. Failed sends are retried with exponential backoff.

type WALSettings

type WALSettings struct {
	// AWS Region where the bucket is located.
	S3Region string `mapstructure:"s3_region"`

	// S3 Bucket where the WAL log files will be added.
	S3Bucket string `mapstructure:"s3_bucket"`

	// WAL flushing options.
	Flush FlushSettings `mapstructure:"flush"`

	// The cluster where the collector is running.
	Cluster string `mapstructure:"cluster"`

	// Enable or disable the WAL.
	Enabled bool `mapstructure:"enabled"`

	UseMinio bool `mapstructure:"use_minio"`

	Minio services.MinioConfig `mapstructure:"minio"`

	// Send by WAL only. Used when we need to send data only by WAL.
	SendByWalOnly bool `mapstructure:"send_by_wal_only"`
}

Jump to

Keyboard shortcuts

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