-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[exporter/elasticsearch] Add ecs mapping for k8s.deployment.name #33622
Merged
andrzej-stencel
merged 2 commits into
open-telemetry:main
from
ChrsMark:add_es_exporter_deploy_name_ecs
Jun 21, 2024
Merged
[exporter/elasticsearch] Add ecs mapping for k8s.deployment.name #33622
andrzej-stencel
merged 2 commits into
open-telemetry:main
from
ChrsMark:add_es_exporter_deploy_name_ecs
Jun 21, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ChrsMark
force-pushed
the
add_es_exporter_deploy_name_ecs
branch
from
June 18, 2024 11:40
721c9e6
to
4b5becf
Compare
ChrsMark
force-pushed
the
add_es_exporter_deploy_name_ecs
branch
2 times, most recently
from
June 18, 2024 11:58
363e311
to
ff26bb6
Compare
lahsivjar
approved these changes
Jun 19, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ChrsMark
force-pushed
the
add_es_exporter_deploy_name_ecs
branch
from
June 20, 2024 09:54
5c63100
to
e9cb9e1
Compare
carsonip
reviewed
Jun 20, 2024
carsonip
approved these changes
Jun 20, 2024
andrzej-stencel
pushed a commit
that referenced
this pull request
Jun 21, 2024
…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>
andrzej-stencel
approved these changes
Jun 21, 2024
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
ChrsMark
force-pushed
the
add_es_exporter_deploy_name_ecs
branch
from
June 21, 2024 13:07
53f6c1e
to
0b0b709
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR adds a mapping for the
k8s.deployment.name
attribute which is enabled by default by thek8sattributesprocessor
.The idea is to have all the enabled by default attributes mapped to ECS properly, for consistency.
Link to tracking Issue: ~
Testing:
Tested locally with:
The documents are stored in ES properly:
Documentation: ~
/cc @carsonip @lahsivjar @andrzej-stencel