Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[exporter/elasticsearch] Support preserving attributes when mapping t…
…o ECS (#33670) **Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This PR adds support for preserving resource attributes that are valid ECS fields in addition of mapping them. At the moment the `host.name` is mapped to the `host.hostname`. Both are valid ECS fields but can differ in some cases. Since there is no such distinction in SemConv right now, it does makes sense to preserve both. refs: - https://www.elastic.co/guide/en/ecs/current/ecs-host.html#field-host-name - https://www.elastic.co/guide/en/ecs/current/ecs-host.html#field-host-hostname **Link to tracking Issue:** <Issue number if applicable> **Testing:** <Describe what testing was performed and which tests were added.> Using the testing notes from #33622. Stored document: ```json { "app": { "label": { "component": "migration-logger" } }, "kubernetes": { "node": { "name": "kind-control-plane" }, "pod": { "uid": "0eda57cd-a4ae-4e89-88fa-c771d3bf0c77", "name": "daemonset-logs-4sqjq" }, "namespace": "default" }, "agent": { "name": "otlp" }, "@timestamp": "2024-06-20T07:27:42.589678923Z", "log": { "iostream": "stdout", "file": { "path": "/var/log/pods/default_daemonset-logs-4sqjq_0eda57cd-a4ae-4e89-88fa-c771d3bf0c77/busybox/0.log" } }, "service": { "name": "migration-logger" }, "k8s": { "container": { "restart_count": "0", "name": "busybox" }, "pod": { "start_time": "2024-06-20T07:27:21Z" }, "daemonset": { "name": "daemonset-logs" } }, "host": { "hostname": "daemonset-opentelemetry-collector-agent-l6pzp", "os": { "type": "linux", "platform": "linux" }, "name": "daemonset-opentelemetry-collector-agent-l6pzp" }, "time": "2024-06-20T07:27:42.589678923Z", "message": "otel logs at 07:27:42", "logtag": "F" } ``` **Documentation:** <Describe the documentation added.> ~ /cc @lahsivjar @andrzej-stencel @carsonip --------- Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
- Loading branch information