open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.71k stars 2.14k forks source link

[exporter/elasticsearch] remove dedup config #33776

Open axw opened 3 days ago

axw commented 3 days ago

Description:

Remove the dedup configuration setting, and always de-duplicate. Elasticsearch does not permit duplicate keys in JSON objects, and this configuration is adding more complexity to the code than it's worth.

Add a deprecation notice to the dedot configuration setting. In the future, de-dotting will always be done for ECS mode, and never for the other modes. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33772 for rationale.

I've simplified the internal/objmodel API slightly, unexporting the Sort methods, which are only required for de-duplication.

Link to tracking Issue:

Closes https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33773

Relates to https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/33772

Testing:

Ran the unit tests, which cover deduplication. None of the tests in package elasticsearchexporter covered dedup: false.

Documentation:

andrzej-stencel commented 2 days ago

@axw Can you split the dedot change into a separate PR please?

axw commented 2 days ago

@andrzej-stencel I've opened https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/33779 and https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/33780 for just the deprecations. I'll mark this one as draft and reopen it after those deprecations are released.