diff --git a/changelog/fragments/1750349806-elasticsearchexporter-deprecated-config.yaml b/changelog/fragments/1750349806-elasticsearchexporter-deprecated-config.yaml new file mode 100644 index 00000000000..0a43e3d0010 --- /dev/null +++ b/changelog/fragments/1750349806-elasticsearchexporter-deprecated-config.yaml @@ -0,0 +1,32 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: enhancement + +# Change summary; a 80ish characters long description of the change. +summary: Remove deprecated otel elasticsearch exporter config `*_dynamic_index` from code and samples + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +#description: + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: elastic-agent + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +pr: https://github.com/elastic/elastic-agent/pull/8592 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/deploy/helm/edot-collector/kube-stack/values.yaml b/deploy/helm/edot-collector/kube-stack/values.yaml index 1c2f3624b12..572339de267 100644 --- a/deploy/helm/edot-collector/kube-stack/values.yaml +++ b/deploy/helm/edot-collector/kube-stack/values.yaml @@ -611,12 +611,6 @@ collectors: endpoints: # List of Elasticsearch endpoints. - ${env:ELASTIC_ENDPOINT} api_key: ${env:ELASTIC_API_KEY} # API key for Elasticsearch authentication. - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true # Enable in order to skip the SSL certificate Check # tls: # insecure_skip_verify: true diff --git a/internal/pkg/otel/samples/darwin/logs_metrics_traces.yml b/internal/pkg/otel/samples/darwin/logs_metrics_traces.yml index fe6f1ffae40..d201bab65ed 100644 --- a/internal/pkg/otel/samples/darwin/logs_metrics_traces.yml +++ b/internal/pkg/otel/samples/darwin/logs_metrics_traces.yml @@ -100,24 +100,12 @@ exporters: api_key: ${env:ELASTIC_API_KEY} mapping: mode: ecs - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true elasticsearch/otel: endpoints: [ "${env:ELASTIC_ENDPOINT}" ] api_key: ${env:ELASTIC_API_KEY} mapping: mode: otel - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true service: extensions: [file_storage] diff --git a/internal/pkg/otel/samples/darwin/platformlogs.yml b/internal/pkg/otel/samples/darwin/platformlogs.yml index 78c69b17f59..7ece09d341d 100644 --- a/internal/pkg/otel/samples/darwin/platformlogs.yml +++ b/internal/pkg/otel/samples/darwin/platformlogs.yml @@ -58,12 +58,6 @@ exporters: api_key: ${env:ELASTIC_API_KEY} mapping: mode: otel - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true service: extensions: [file_storage] diff --git a/internal/pkg/otel/samples/darwin/platformlogs_hostmetrics.yml b/internal/pkg/otel/samples/darwin/platformlogs_hostmetrics.yml index 2f593117109..d467526f10b 100644 --- a/internal/pkg/otel/samples/darwin/platformlogs_hostmetrics.yml +++ b/internal/pkg/otel/samples/darwin/platformlogs_hostmetrics.yml @@ -91,23 +91,11 @@ exporters: api_key: ${env:ELASTIC_API_KEY} mapping: mode: ecs - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true elasticsearch/otel: endpoints: [ "${env:ELASTIC_ENDPOINT}" ] api_key: ${env:ELASTIC_API_KEY} mapping: mode: otel - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true service: extensions: [file_storage] diff --git a/internal/pkg/otel/samples/linux/gateway.yml b/internal/pkg/otel/samples/linux/gateway.yml index 5a954050dac..f4a69818252 100644 --- a/internal/pkg/otel/samples/linux/gateway.yml +++ b/internal/pkg/otel/samples/linux/gateway.yml @@ -49,12 +49,6 @@ exporters: endpoints: - ${ELASTIC_ENDPOINT} # Will be populated from environment variable api_key: ${ELASTIC_API_KEY} # Will be populated from environment variable - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true # tls: # insecure_skip_verify: true mapping: diff --git a/internal/pkg/otel/samples/linux/logs_metrics_traces.yml b/internal/pkg/otel/samples/linux/logs_metrics_traces.yml index 50d0bde3e7e..e2b9c28f09a 100644 --- a/internal/pkg/otel/samples/linux/logs_metrics_traces.yml +++ b/internal/pkg/otel/samples/linux/logs_metrics_traces.yml @@ -107,24 +107,12 @@ exporters: api_key: ${env:ELASTIC_API_KEY} mapping: mode: ecs - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true elasticsearch/otel: endpoints: [ "${env:ELASTIC_ENDPOINT}" ] api_key: ${env:ELASTIC_API_KEY} mapping: mode: otel - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true service: extensions: [file_storage] diff --git a/internal/pkg/otel/samples/linux/platformlogs.yml b/internal/pkg/otel/samples/linux/platformlogs.yml index 78c69b17f59..7ece09d341d 100644 --- a/internal/pkg/otel/samples/linux/platformlogs.yml +++ b/internal/pkg/otel/samples/linux/platformlogs.yml @@ -58,12 +58,6 @@ exporters: api_key: ${env:ELASTIC_API_KEY} mapping: mode: otel - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true service: extensions: [file_storage] diff --git a/internal/pkg/otel/samples/linux/platformlogs_hostmetrics.yml b/internal/pkg/otel/samples/linux/platformlogs_hostmetrics.yml index 41cdbbf9691..7eae8a59f99 100644 --- a/internal/pkg/otel/samples/linux/platformlogs_hostmetrics.yml +++ b/internal/pkg/otel/samples/linux/platformlogs_hostmetrics.yml @@ -98,23 +98,11 @@ exporters: api_key: ${env:ELASTIC_API_KEY} mapping: mode: ecs - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true elasticsearch/otel: endpoints: [ "${env:ELASTIC_ENDPOINT}" ] api_key: ${env:ELASTIC_API_KEY} mapping: mode: otel - logs_dynamic_index: - enabled: true - metrics_dynamic_index: - enabled: true - traces_dynamic_index: - enabled: true service: extensions: [file_storage] diff --git a/internal/pkg/otel/translate/otelconfig.go b/internal/pkg/otel/translate/otelconfig.go index cf3a66bf13e..bada4abc252 100644 --- a/internal/pkg/otel/translate/otelconfig.go +++ b/internal/pkg/otel/translate/otelconfig.go @@ -401,9 +401,7 @@ func translateEsOutputToExporter(cfg *config.C) (map[string]any, error) { if err != nil { return nil, err } - // we want to use dynamic indexing - esConfig["logs_index"] = "" // needs to be empty for logs_dynamic_index - esConfig["logs_dynamic_index"] = map[string]any{"enabled": true} + // dynamic indexing works by default // we also want to use dynamic log ids esConfig["logs_dynamic_id"] = map[string]any{"enabled": true} diff --git a/internal/pkg/otel/translate/otelconfig_test.go b/internal/pkg/otel/translate/otelconfig_test.go index 254b1a7ff2d..b58364d2c8f 100644 --- a/internal/pkg/otel/translate/otelconfig_test.go +++ b/internal/pkg/otel/translate/otelconfig_test.go @@ -223,7 +223,6 @@ func TestGetOtelConfig(t *testing.T) { "max_size": 1600, "min_size": 0, }, - "logs_index": "", "mapping": map[string]any{ "mode": "bodymap", }, @@ -236,9 +235,6 @@ func TestGetOtelConfig(t *testing.T) { "max_interval": 1 * time.Minute, "max_retries": 3, }, - "logs_dynamic_index": map[string]any{ - "enabled": true, - }, "logs_dynamic_id": map[string]any{ "enabled": true, },