elasticsearchexporter

package module
v0.114.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 48 Imported by: 4

README

Elasticsearch Exporter

Status
Stability development: metrics
beta: traces, logs
Distributions contrib
Issues Open issues Closed issues
Code Owners @JaredTan95, @carsonip, @lahsivjar

This exporter supports sending logs, metrics and traces to Elasticsearch.

Configuration options

Exactly one of the following settings is required:

  • endpoint (no default): The target Elasticsearch URL to which data will be sent (e.g. https://elasticsearch:9200)
  • endpoints (no default): A list of Elasticsearch URLs to which data will be sent, attempted in round-robin order
  • cloudid (no default): The Elastic Cloud ID of the Elastic Cloud Cluster to which data will be sent (e.g. foo:YmFyLmNsb3VkLmVzLmlvJGFiYzEyMyRkZWY0NTY=)

When the above settings are missing, endpoints will default to the comma-separated ELASTICSEARCH_URL environment variable.

Elasticsearch credentials may be configured via Authentication configuration settings. As a shortcut, the following settings are also supported:

  • user (optional): Username used for HTTP Basic Authentication.
  • password (optional): Password used for HTTP Basic Authentication.
  • api_key (optional): Elasticsearch API Key in "encoded" format.

Example:

exporters:
  elasticsearch:
    endpoint: https://elastic.example.com:9200
    auth:
      authenticator: basicauth

extensions:
  basicauth:
    client_auth:
      username: elastic
      password: changeme

······

service:
  extensions: [basicauth]
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [elasticsearch]
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [elasticsearch]

Advanced configuration

HTTP settings

The Elasticsearch exporter supports common HTTP Configuration Settings. Gzip compression is enabled by default. To disable compression, set compression to none. As a consequence of supporting confighttp, the Elasticsearch exporter also supports common TLS Configuration Settings.

The Elasticsearch exporter sets timeout (HTTP request timeout) to 90s by default. All other defaults are as defined by confighttp.

Queuing

The Elasticsearch exporter supports the common sending_queue settings. However, the sending queue is currently disabled by default.

Batching

[!WARNING] The batcher config is experimental and may change without notice.

The Elasticsearch exporter supports the common batcher settings.

  • batcher:
    • enabled (default=unset): Enable batching of requests into a single bulk request.
    • min_size_items (default=5000): Minimum number of log records / spans in the buffer to trigger a flush immediately.
    • max_size_items (default=10000): Maximum number of log records / spans in a request.
    • flush_timeout (default=30s): Maximum time of the oldest item spent inside the buffer, aka "max age of buffer". A flush will happen regardless of the size of content in buffer.

By default, the exporter will perform its own buffering and batching, as configured through the flush config, and batcher will be unused. By setting batcher::enabled to either true or false, the exporter will not perform any of its own buffering or batching, and the flush config will be ignored. In a future release when the batcher config is stable, and has feature parity with the exporter's existing flush config, it will be enabled by default.

Using the common batcher functionality provides several benefits over the default behavior:

  • Combined with a persistent queue, or no queue at all, batcher enables at least once delivery. With the default behavior, the exporter will accept data and process it asynchronously, which interacts poorly with queuing.
  • By ensuring the exporter makes requests to Elasticsearch synchronously, client metadata can be passed through to Elasticsearch requests, e.g. by using the headers_setter extension.
Elasticsearch document routing

Telemetry data will be written to signal specific data streams by default: logs to logs-generic-default, metrics to metrics-generic-default, and traces to traces-generic-default. This can be customised through the following settings:

  • index (DEPRECATED, please use logs_index for logs, metrics_index for metrics, traces_index for traces): The index or data stream name to publish events to. The default value is logs-generic-default.

  • logs_index: The index or data stream name to publish events to. The default value is logs-generic-default

  • logs_dynamic_index (optional): uses resource, scope, or log record attributes to dynamically construct index name.

    • enabled(default=false): Enable/Disable dynamic index for log records. If data_stream.dataset or data_stream.namespace exist in attributes (precedence: log record attribute > scope attribute > resource attribute), they will be used to dynamically construct index name in the form logs-${data_stream.dataset}-${data_stream.namespace}. Otherwise, if elasticsearch.index.prefix or elasticsearch.index.suffix exist in attributes (precedence: resource attribute > scope attribute > log record attribute), they will be used to dynamically construct index name in the form ${elasticsearch.index.prefix}${logs_index}${elasticsearch.index.suffix}. Otherwise, if scope name matches regex /receiver/(\w*receiver), data_stream.dataset will be capture group #1. Otherwise, the index name falls back to logs-generic-default, and logs_index config will be ignored. Except for prefix/suffix attribute presence, the resulting docs will contain the corresponding data_stream.* fields, see restrictions applied to Data Stream Fields.
  • metrics_index (optional): The index or data stream name to publish metrics to. The default value is metrics-generic-default. ⚠️ Note that metrics support is currently in development.

  • metrics_dynamic_index (optional): uses resource, scope or data point attributes to dynamically construct index name. ⚠️ Note that metrics support is currently in development.

    • enabled(default=true): Enable/disable dynamic index for metrics. If data_stream.dataset or data_stream.namespace exist in attributes (precedence: data point attribute > scope attribute > resource attribute), they will be used to dynamically construct index name in the form metrics-${data_stream.dataset}-${data_stream.namespace}. Otherwise, if elasticsearch.index.prefix or elasticsearch.index.suffix exist in attributes (precedence: resource attribute > scope attribute > data point attribute), they will be used to dynamically construct index name in the form ${elasticsearch.index.prefix}${metrics_index}${elasticsearch.index.suffix}. Otherwise, if scope name matches regex /receiver/(\w*receiver), data_stream.dataset will be capture group #1. Otherwise, the index name falls back to metrics-generic-default, and metrics_index config will be ignored. Except for prefix/suffix attribute presence, the resulting docs will contain the corresponding data_stream.* fields, see restrictions applied to Data Stream Fields.
  • traces_index: The index or data stream name to publish traces to. The default value is traces-generic-default.

  • traces_dynamic_index (optional): uses resource, scope, or span attributes to dynamically construct index name.

    • enabled(default=false): Enable/Disable dynamic index for trace spans. If data_stream.dataset or data_stream.namespace exist in attributes (precedence: span attribute > scope attribute > resource attribute), they will be used to dynamically construct index name in the form traces-${data_stream.dataset}-${data_stream.namespace}. Otherwise, if elasticsearch.index.prefix or elasticsearch.index.suffix exist in attributes (precedence: resource attribute > scope attribute > span attribute), they will be used to dynamically construct index name in the form ${elasticsearch.index.prefix}${traces_index}${elasticsearch.index.suffix}. Otherwise, if scope name matches regex /receiver/(\w*receiver), data_stream.dataset will be capture group #1. Otherwise, the index name falls back to traces-generic-default, and traces_index config will be ignored. Except for prefix/suffix attribute presence, the resulting docs will contain the corresponding data_stream.* fields, see restrictions applied to Data Stream Fields. There is an exception for span events under OTel mapping mode (mapping::mode: otel), where span event attributes instead of span attributes are considered, and data_stream.type is always logs instead of traces such that documents are routed to logs-${data_stream.dataset}-${data_stream.namespace}.
  • logstash_format (optional): Logstash format compatibility. Logs, metrics and traces can be written into an index in Logstash format.

    • enabled(default=false): Enable/disable Logstash format compatibility. When logstash_format.enabled is true, the index name is composed using (logs|metrics|traces)_index or (logs|metrics|traces)_dynamic_index as prefix and the date as suffix, e.g: If logs_index or logs_dynamic_index is equal to logs-generic-default, your index will become logs-generic-default-YYYY.MM.DD. The last string appended belongs to the date when the data is being generated.
    • prefix_separator(default=-): Set a separator between logstash_prefix and date.
    • date_format(default=%Y.%m.%d): Time format (based on strftime) to generate the second part of the Index name.
Elasticsearch document mapping

The Elasticsearch exporter supports several document schemas and preprocessing behaviours, which may be configured through the following settings:

  • mapping: Events are encoded to JSON. The mapping allows users to configure additional mapping rules.
    • mode (default=none): The fields naming mode. valid modes are:
      • none: Use original fields and event structure from the OTLP event.

      • ecs: Try to map fields to Elastic Common Schema (ECS)

      • otel: Elastic's preferred "OTel-native" mapping mode. Uses original fields and event structure from the OTLP event.

        • ⚠ This mode's behavior is unstable, it is currently experimental and undergoing changes.
        • There's a special treatment for the following attributes: data_stream.type, data_stream.dataset, data_stream.namespace. Instead of serializing these values under the *attributes.* namespace, they're put at the root of the document, to conform with the conventions of the data stream naming scheme that maps these as constant_keyword fields.
        • data_stream.dataset will always be appended with .otel. It is recommended to use with *_dynamic_index.enabled: true to route documents to data stream ${data_stream.type}-${data_stream.dataset}-${data_stream.namespace}.
        • Span events are stored in separate documents. They will be routed with data_stream.type set to logs if traces_dynamic_index::enabled is true.
      • raw: Omit the Attributes. string prefixed to field names for log and span attributes as well as omit the Events. string prefixed to field names for span events.

      • bodymap: Provides fine-grained control over the final documents to be ingested. ⚠ This mode's behavior is unstable, it is currently experimental and undergoing changes. It works only for logs where the log record body is a map. Each LogRecord body is serialized to JSON as-is and becomes a separate document for ingestion. If the log record body is not a map, the exporter will log a warning and drop the log record.

    • dedup (DEPRECATED). This configuration is deprecated and non-operational, and will be removed in the future. Object keys are always deduplicated to avoid Elasticsearch rejecting documents.
    • dedot (default=true; DEPRECATED, in future dedotting will always be enabled for ECS mode, and never for other modes): When enabled attributes with . will be split into proper json objects.
ECS mapping mode

[!WARNING] The ECS mode mapping mode is currently undergoing changes, and its behaviour is unstable.

In ECS mapping mode, the Elasticsearch Exporter attempts to map fields from OpenTelemetry Semantic Conventions (version 1.22.0) to Elastic Common Schema. This mode may be used for compatibility with existing dashboards that work with ECS.

Elasticsearch ingest pipeline

Documents may be optionally passed through an Elasticsearch Ingest pipeline prior to indexing. This can be configured through the following settings:

Elasticsearch bulk indexing

The Elasticsearch exporter uses the Elasticsearch Bulk API for indexing documents. The behaviour of this bulk indexing can be configured with the following settings:

  • num_workers (default=runtime.NumCPU()): Number of workers publishing bulk requests concurrently.
  • flush: Event bulk indexer buffer flush settings
    • bytes (default=5000000): Write buffer flush size limit.
    • interval (default=30s): Write buffer flush time limit.
  • retry: Elasticsearch bulk request retry settings
    • enabled (default=true): Enable/Disable request retry on error. Failed requests are retried with exponential backoff.
    • max_requests (DEPRECATED, use retry::max_retries instead): Number of HTTP request retries including the initial attempt. If used, retry::max_retries will be set to max_requests - 1.
    • max_retries (default=2): Number of HTTP request retries. To disable retries, set retry::enabled to false instead of setting max_retries to 0.
    • initial_interval (default=100ms): Initial waiting time if a HTTP request failed.
    • max_interval (default=1m): Max waiting time if a HTTP request failed.
    • retry_on_status (default=[429]): Status codes that trigger request or document level retries. Request level retry and document level retry status codes are shared and cannot be configured separately. To avoid duplicates, it defaults to [429].

[!NOTE] The flush config will be ignored when batcher::enabled config is explicitly set to true or false.

Elasticsearch node discovery

The Elasticsearch Exporter will regularly check Elasticsearch for available nodes. Newly discovered nodes will automatically be used for load balancing. Settings related to node discovery are:

  • discover:
    • on_start (optional): If enabled the exporter queries Elasticsearch for all known nodes in the cluster on startup.
    • interval (optional): Interval to update the list of Elasticsearch nodes.

Node discovery can be disabled by setting discover.interval to 0.

Telemetry settings

The Elasticsearch Exporter's own telemetry settings for testing and debugging purposes.

⚠️ This is experimental and may change at any time.

  • telemetry:
    • log_request_body (default=false): Logs Elasticsearch client request body as a field in a log line at DEBUG level. It requires service::telemetry::logs::level to be set to debug. WARNING: Enabling this config may expose sensitive data.
    • log_response_body (default=false): Logs Elasticsearch client response body as a field in a log line at DEBUG level. It requires service::telemetry::logs::level to be set to debug. WARNING: Enabling this config may expose sensitive data.

Exporting metrics

Metrics support is currently in development. The metric types supported are:

  • Gauge
  • Sum
  • Histogram (Delta temporality only)
  • Exponential histogram (Delta temporality only)
  • Summary

ECS Mapping

elasticsearchexporter follows ECS mapping defined here: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model-appendix.md#elastic-common-schema

When mode is set to ecs, elasticsearchexporter performs conversions for resource-level attributes from their Semantic Conventions (SemConv) names to equivalent Elastic Common Schema (ECS) names.

If the target ECS field name is specified as an empty string (""), the converter will neither convert the SemConv key to the equivalent ECS name nor pass through the SemConv key as-is to become the ECS name.

When "Preserved" is true, the attribute will be preserved in the payload and duplicated as mapped to its ECS equivalent.

Semantic Convention Name ECS Name Preserve
cloud.platform cloud.service.name false
container.image.tags container.image.tag false
deployment.environment service.environment false
host.arch host.architecture false
host.name host.hostname true
k8s.cluster.name orchestrator.cluster.name false
k8s.container.name kubernetes.container.name false
k8s.cronjob.name kubernetes.cronjob.name false
k8s.daemonset.name kubernetes.daemonset.name false
k8s.deployment.name kubernetes.deployment.name false
k8s.job.name kubernetes.job.name false
k8s.namespace.name kubernetes.namespace false
k8s.node.name kubernetes.node.name false
k8s.pod.name kubernetes.pod.name false
k8s.pod.uid kubernetes.pod.uid false
k8s.replicaset.name kubernetes.replicaset.name false
k8s.statefulset.name kubernetes.statefulset.name false
os.description host.os.full false
os.name host.os.name false
os.type host.os.platform false
os.version host.os.version false
process.executable.path process.executable false
process.runtime.name service.runtime.name false
process.runtime.version service.runtime.version false
service.instance.id service.node.name false
telemetry.distro.name "" false
telemetry.distro.version "" false
telemetry.sdk.language "" false
telemetry.sdk.name "" false
telemetry.sdk.version "" false
Compound Mapping

There are ECS fields that are not mapped easily 1 to 1 but require more advanced logic.

agent.name

The agent name takes the form of a compound name consisting of 3 components:

  • telemetry.sdk.name or, if not present, defaults to otlp,
  • telemetry.sdk.language, defaulting to unknown in case it is missing,
  • telemetry.distro.name, which is allowed to be empty.

These values are all valid:

telemetry.sdk.name telemetry.sdk.language telemetry.distro.name agent.name
"" "" "" otlp/unknown
"" dotnet "" otlp/dotnet
opentelemetry dotnet "" opentelemetry/dotnet
"" java parts-unlimited-java otlp/java/parts-unlimited-java
"" "" parts-unlimited-java otlp/unknown/parts-unlimited-java
agent.version

Takes the value of telemetry.distro.version or telemetry.sdk.version. If both telemetry.distro.version and telemetry.sdk.version are present, telemetry.distro.version takes precedence.

host.os.type

Maps values of os.type in the following manner:

SemConv Value ECS Value
windows windows
linux linux
darwin macos
aix unix
hpux unix
solaris unix

In case os.name is present and falls within the specified range of values:

SemConv Value ECS Value
Android android
iOS ios

Otherwise, it is mapped to an empty string ("").

@timestamp

In case the record contains timestamp, this value is used. Otherwise, the observed timestamp is used.

Known issues

version_conflict_engine_exception

When sending high traffic of metrics to a TSDB metrics data stream, e.g. using OTel mapping mode to a 8.16 Elasticsearch, it is possible to get error logs "failed to index document" with error.type "version_conflict_engine_exception" and error.reason containing "version conflict, document already exists". It is due to Elasticsearch grouping metrics with the same dimensions, whether it is the same or different metric name, using @timestamp in milliseconds precision as opposed to nanoseconds in elasticsearchexporter.

This will be fixed in a future version of Elasticsearch. A possible workaround would be to use a transform processor to truncate the timestamp, but this will cause duplicate data to be dropped silently.

However, if @timestamp precision is not the problem, check your metrics pipeline setup for misconfiguration that causes an actual violation of the single writer principle.

Documentation

Overview

Package elasticsearchexporter contains an opentelemetry-collector exporter for Elasticsearch.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTypeForBodyMapMode = errors.New("invalid log record body type for 'bodymap' mapping mode")

Functions

func NewFactory

func NewFactory() exporter.Factory

NewFactory creates a factory for Elastic exporter.

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 configopaque.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 configopaque.String `mapstructure:"api_key"`
}

AuthenticationSettings defines user authentication related settings.

type BatcherConfig added in v0.107.0

type BatcherConfig struct {
	// Enabled indicates whether to enqueue batches before sending
	// to the exporter. If Enabled is specified (non-nil),
	// then the exporter will not perform any buffering itself.
	Enabled *bool `mapstructure:"enabled"`

	// FlushTimeout sets the time after which a batch will be sent regardless of its size.
	FlushTimeout time.Duration `mapstructure:"flush_timeout"`

	exporterbatcher.MinSizeConfig `mapstructure:",squash"`
	exporterbatcher.MaxSizeConfig `mapstructure:",squash"`
}

BatcherConfig holds configuration for exporterbatcher.

This is a slightly modified version of exporterbatcher.Config, to enable tri-state Enabled: unset, false, true.

type Config

type Config struct {
	QueueSettings exporterhelper.QueueConfig `mapstructure:"sending_queue"`
	// 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"`

	// 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
	//
	// Deprecated: `index` is deprecated and replaced with `logs_index`.
	Index string `mapstructure:"index"`

	// This setting is required when logging pipelines used.
	LogsIndex string `mapstructure:"logs_index"`
	// fall back to pure LogsIndex, if 'elasticsearch.index.prefix' or 'elasticsearch.index.suffix' are not found in resource or attribute (prio: resource > attribute)
	LogsDynamicIndex DynamicIndexSetting `mapstructure:"logs_dynamic_index"`

	// This setting is required when the exporter is used in a metrics pipeline.
	MetricsIndex string `mapstructure:"metrics_index"`
	// fall back to pure MetricsIndex, if 'elasticsearch.index.prefix' or 'elasticsearch.index.suffix' are not found in resource attributes
	MetricsDynamicIndex DynamicIndexSetting `mapstructure:"metrics_dynamic_index"`

	// This setting is required when traces pipelines used.
	TracesIndex string `mapstructure:"traces_index"`
	// fall back to pure TracesIndex, if 'elasticsearch.index.prefix' or 'elasticsearch.index.suffix' are not found in resource or attribute (prio: resource > attribute)
	TracesDynamicIndex DynamicIndexSetting `mapstructure:"traces_dynamic_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"`

	confighttp.ClientConfig `mapstructure:",squash"`
	Authentication          AuthenticationSettings `mapstructure:",squash"`
	Discovery               DiscoverySettings      `mapstructure:"discover"`
	Retry                   RetrySettings          `mapstructure:"retry"`
	Flush                   FlushSettings          `mapstructure:"flush"`
	Mapping                 MappingsSettings       `mapstructure:"mapping"`
	LogstashFormat          LogstashFormatSettings `mapstructure:"logstash_format"`

	// TelemetrySettings contains settings useful for testing/debugging purposes
	// This is experimental and may change at any time.
	TelemetrySettings `mapstructure:"telemetry"`

	// Batcher holds configuration for batching requests based on timeout
	// and size-based thresholds.
	//
	// Batcher is unused by default, in which case Flush will be used.
	// If Batcher.Enabled is non-nil (i.e. batcher::enabled is specified),
	// then the Flush will be ignored even if Batcher.Enabled is false.
	Batcher BatcherConfig `mapstructure:"batcher"`
}

Config defines configuration for Elastic exporter.

func (*Config) MappingMode added in v0.94.0

func (cfg *Config) MappingMode() MappingMode

MappingMode returns the mapping.mode defined in the given cfg object. This method must be called after cfg.Validate() has been called without returning an error.

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 DynamicIndexSetting added in v0.78.0

type DynamicIndexSetting struct {
	Enabled bool `mapstructure:"enabled"`
}

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 LogstashFormatSettings added in v0.91.0

type LogstashFormatSettings struct {
	Enabled         bool   `mapstructure:"enabled"`
	PrefixSeparator string `mapstructure:"prefix_separator"`
	DateFormat      string `mapstructure:"date_format"`
}

type MappingMode

type MappingMode int
const (
	MappingNone MappingMode = iota
	MappingECS
	MappingOTel
	MappingRaw
	MappingBodyMap
)

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"`

	// Dedup is non-operational, and will be removed in the future.
	//
	// Deprecated: [v0.104.0] deduplication is always enabled, and cannot be
	// disabled. Disabling deduplication is not meaningful, as Elasticsearch
	// will always reject documents with duplicate JSON object keys.
	Dedup *bool `mapstructure:"dedup,omitempty"`

	// Deprecated: [v0.104.0] dedotting will always be applied for ECS mode
	// in future, and never for other modes. Elasticsearch's "dot_expander"
	// Ingest processor may be used as an alternative for non-ECS modes.
	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 attempted before it is assumed to be failed.
	// Deprecated: use MaxRetries instead.
	MaxRequests int `mapstructure:"max_requests"`

	// MaxRetries configures how many times an HTTP request is retried.
	MaxRetries int `mapstructure:"max_retries"`

	// 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"`

	// RetryOnStatus configures the status codes that trigger request or document level retries.
	RetryOnStatus []int `mapstructure:"retry_on_status"`
}

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

type TelemetrySettings added in v0.105.0

type TelemetrySettings struct {
	LogRequestBody  bool `mapstructure:"log_request_body"`
	LogResponseBody bool `mapstructure:"log_response_body"`
}

Directories

Path Synopsis
internal
exphistogram
Package exphistogram contains utility functions for exponential histogram conversions.
Package exphistogram contains utility functions for exponential histogram conversions.

Jump to

Keyboard shortcuts

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