-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Inventory] Inventory k8s entities fixes #201260
[Inventory] Inventory k8s entities fixes #201260
Conversation
/ci |
3284ad5
to
7900589
Compare
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
Pinging @elastic/obs-entities (Team:obs-entities) |
This PR also closes https://github.com/elastic/elastic-entity-model/issues/170 and you might fix with this new capability https://github.com/elastic/elastic-entity-model/issues/168 |
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.
This looks fine to me, but do note that using UID is only unique within the cluster but I think that's something you guys are aware of already?
If you want a global ID then you need to combine the cluster name and resource name to improve the chances of not having conflicts.
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
@miltonhultgren I think we still need to look into this. cc: @roshan-elastic |
if (!definition.metadata) { | ||
return ''; | ||
} | ||
const displayNameField = definition.displayNameTemplate.replace(/[{}]/g, ''); |
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.
Would this break if displayNameTemplate includes more than a single field ? something like {{field1}} - {{field2}}
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.
I'd rather explicitly setting the metadata aggregation on the definition instead of this logic since it looks hard to get right
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.
I agree with this, I'd rather the user has to pick a single field to use and if that field is not set we fallback to the ID.
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.
I didn't consider displayNameTemplate with multiple fields. I'll change this.
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.
@klacabane fixed here: 2bb2e1e
Good catch both. I'm thinking that we could:
That way, we don't accidentally merge different pods with the same UID but users can easily see (and filter by) the pod UID). WDYT? |
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
Quick Q on this @crespocarlos - I assume the above hasn't gone into the PR (and might be a valid follow up issue)? |
Exactly. We need a follow up ticket to investigate this. |
Cool @crespocarlos - one thing we need to be mindful of is how alerts will be associated with a k8s entity (cc @kpatticha) as I think they 'group by' the entity identifying field. |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
|
Starting backport for target branches: 8.17, 8.x |
closes [elastic#201226](elastic#201226) ## Summary This PR makes the final adjustments on k8s entities after the elastic#196916 was merged. I had to fix most of the ECS entities because they had their `entityId` defined with `uid` field. Most of the ECS K8s entities don't have this field and should use the `name` field instead (see [metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41)) ~I also had to fix the transforms to include an aggregation for the `displayNameTemplate` field, when it doesn't match with the `entity.Id`~ ### Real data Otel The screenshots below are from a tests running the `opentemeletry-demo` sending otel data <img width="710" alt="image" src="https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17"> <img width="710" alt="image" src="https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8"> ### Real data ECS The screenshots below are from a tests running the `opentemeletry-demo` with elastic agent installed with Kubernetes integration <img width="710" alt="image" src="https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1"> <img width="710" alt="image" src="https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b"> ### Additional test with synthtrace <img width="709" alt="image" src="https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8"> ### Fix ECS k8s service entity was missing the link to its corresponding dashboard <img width="709" alt="image" src="https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798"> <img width="709" alt="image" src="https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e"> ### How to test - Start local kibana and es instances - run ` node scripts/synthtrace k8s_entities.ts --clean --live` - Navigate to Inventory and enable EEM --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit aead7b9)
closes [elastic#201226](elastic#201226) ## Summary This PR makes the final adjustments on k8s entities after the elastic#196916 was merged. I had to fix most of the ECS entities because they had their `entityId` defined with `uid` field. Most of the ECS K8s entities don't have this field and should use the `name` field instead (see [metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41)) ~I also had to fix the transforms to include an aggregation for the `displayNameTemplate` field, when it doesn't match with the `entity.Id`~ ### Real data Otel The screenshots below are from a tests running the `opentemeletry-demo` sending otel data <img width="710" alt="image" src="https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17"> <img width="710" alt="image" src="https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8"> ### Real data ECS The screenshots below are from a tests running the `opentemeletry-demo` with elastic agent installed with Kubernetes integration <img width="710" alt="image" src="https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1"> <img width="710" alt="image" src="https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b"> ### Additional test with synthtrace <img width="709" alt="image" src="https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8"> ### Fix ECS k8s service entity was missing the link to its corresponding dashboard <img width="709" alt="image" src="https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798"> <img width="709" alt="image" src="https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e"> ### How to test - Start local kibana and es instances - run ` node scripts/synthtrace k8s_entities.ts --clean --live` - Navigate to Inventory and enable EEM --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit aead7b9)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.17`: - [[Inventory] Inventory k8s entities fixes (#201260)](#201260) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Carlos Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-26T08:29:23Z","message":"[Inventory] Inventory k8s entities fixes (#201260)\n\ncloses [#201226](https://github.com/elastic/kibana/issues/201226)\r\n\r\n## Summary\r\n\r\nThis PR makes the final adjustments on k8s entities after the\r\nhttps://github.com//pull/196916 was merged.\r\n\r\nI had to fix most of the ECS entities because they had their `entityId`\r\ndefined with `uid` field. Most of the ECS K8s entities don't have this\r\nfield and should use the `name` field instead (see\r\n[metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41))\r\n\r\n~I also had to fix the transforms to include an aggregation for the\r\n`displayNameTemplate` field, when it doesn't match with the `entity.Id`~\r\n\r\n### Real data Otel\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nsending otel data\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17\">\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8\">\r\n\r\n### Real data ECS\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nwith elastic agent installed with Kubernetes integration\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1\">\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b\">\r\n\r\n\r\n### Additional test with synthtrace\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8\">\r\n\r\n### Fix\r\n\r\nECS k8s service entity was missing the link to its corresponding\r\ndashboard\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798\">\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e\">\r\n\r\n\r\n### How to test\r\n\r\n- Start local kibana and es instances\r\n- run ` node scripts/synthtrace k8s_entities.ts --clean --live`\r\n- Navigate to Inventory and enable EEM\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"aead7b9acd5de0e5668c5f860eda473071a5a42d","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","Team:obs-entities","backport:version","v8.17.0"],"title":"[Inventory] Inventory k8s entities fixes","number":201260,"url":"https://github.com/elastic/kibana/pull/201260","mergeCommit":{"message":"[Inventory] Inventory k8s entities fixes (#201260)\n\ncloses [#201226](https://github.com/elastic/kibana/issues/201226)\r\n\r\n## Summary\r\n\r\nThis PR makes the final adjustments on k8s entities after the\r\nhttps://github.com//pull/196916 was merged.\r\n\r\nI had to fix most of the ECS entities because they had their `entityId`\r\ndefined with `uid` field. Most of the ECS K8s entities don't have this\r\nfield and should use the `name` field instead (see\r\n[metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41))\r\n\r\n~I also had to fix the transforms to include an aggregation for the\r\n`displayNameTemplate` field, when it doesn't match with the `entity.Id`~\r\n\r\n### Real data Otel\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nsending otel data\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17\">\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8\">\r\n\r\n### Real data ECS\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nwith elastic agent installed with Kubernetes integration\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1\">\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b\">\r\n\r\n\r\n### Additional test with synthtrace\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8\">\r\n\r\n### Fix\r\n\r\nECS k8s service entity was missing the link to its corresponding\r\ndashboard\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798\">\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e\">\r\n\r\n\r\n### How to test\r\n\r\n- Start local kibana and es instances\r\n- run ` node scripts/synthtrace k8s_entities.ts --clean --live`\r\n- Navigate to Inventory and enable EEM\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"aead7b9acd5de0e5668c5f860eda473071a5a42d"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201260","number":201260,"mergeCommit":{"message":"[Inventory] Inventory k8s entities fixes (#201260)\n\ncloses [#201226](https://github.com/elastic/kibana/issues/201226)\r\n\r\n## Summary\r\n\r\nThis PR makes the final adjustments on k8s entities after the\r\nhttps://github.com//pull/196916 was merged.\r\n\r\nI had to fix most of the ECS entities because they had their `entityId`\r\ndefined with `uid` field. Most of the ECS K8s entities don't have this\r\nfield and should use the `name` field instead (see\r\n[metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41))\r\n\r\n~I also had to fix the transforms to include an aggregation for the\r\n`displayNameTemplate` field, when it doesn't match with the `entity.Id`~\r\n\r\n### Real data Otel\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nsending otel data\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17\">\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8\">\r\n\r\n### Real data ECS\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nwith elastic agent installed with Kubernetes integration\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1\">\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b\">\r\n\r\n\r\n### Additional test with synthtrace\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8\">\r\n\r\n### Fix\r\n\r\nECS k8s service entity was missing the link to its corresponding\r\ndashboard\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798\">\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e\">\r\n\r\n\r\n### How to test\r\n\r\n- Start local kibana and es instances\r\n- run ` node scripts/synthtrace k8s_entities.ts --clean --live`\r\n- Navigate to Inventory and enable EEM\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"aead7b9acd5de0e5668c5f860eda473071a5a42d"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Carlos Crespo <[email protected]>
# Backport This will backport the following commits from `main` to `8.x`: - [[Inventory] Inventory k8s entities fixes (#201260)](#201260) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Carlos Crespo","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-26T08:29:23Z","message":"[Inventory] Inventory k8s entities fixes (#201260)\n\ncloses [#201226](https://github.com/elastic/kibana/issues/201226)\r\n\r\n## Summary\r\n\r\nThis PR makes the final adjustments on k8s entities after the\r\nhttps://github.com//pull/196916 was merged.\r\n\r\nI had to fix most of the ECS entities because they had their `entityId`\r\ndefined with `uid` field. Most of the ECS K8s entities don't have this\r\nfield and should use the `name` field instead (see\r\n[metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41))\r\n\r\n~I also had to fix the transforms to include an aggregation for the\r\n`displayNameTemplate` field, when it doesn't match with the `entity.Id`~\r\n\r\n### Real data Otel\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nsending otel data\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17\">\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8\">\r\n\r\n### Real data ECS\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nwith elastic agent installed with Kubernetes integration\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1\">\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b\">\r\n\r\n\r\n### Additional test with synthtrace\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8\">\r\n\r\n### Fix\r\n\r\nECS k8s service entity was missing the link to its corresponding\r\ndashboard\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798\">\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e\">\r\n\r\n\r\n### How to test\r\n\r\n- Start local kibana and es instances\r\n- run ` node scripts/synthtrace k8s_entities.ts --clean --live`\r\n- Navigate to Inventory and enable EEM\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"aead7b9acd5de0e5668c5f860eda473071a5a42d","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","Team:obs-entities","backport:version","v8.17.0"],"title":"[Inventory] Inventory k8s entities fixes","number":201260,"url":"https://github.com/elastic/kibana/pull/201260","mergeCommit":{"message":"[Inventory] Inventory k8s entities fixes (#201260)\n\ncloses [#201226](https://github.com/elastic/kibana/issues/201226)\r\n\r\n## Summary\r\n\r\nThis PR makes the final adjustments on k8s entities after the\r\nhttps://github.com//pull/196916 was merged.\r\n\r\nI had to fix most of the ECS entities because they had their `entityId`\r\ndefined with `uid` field. Most of the ECS K8s entities don't have this\r\nfield and should use the `name` field instead (see\r\n[metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41))\r\n\r\n~I also had to fix the transforms to include an aggregation for the\r\n`displayNameTemplate` field, when it doesn't match with the `entity.Id`~\r\n\r\n### Real data Otel\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nsending otel data\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17\">\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8\">\r\n\r\n### Real data ECS\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nwith elastic agent installed with Kubernetes integration\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1\">\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b\">\r\n\r\n\r\n### Additional test with synthtrace\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8\">\r\n\r\n### Fix\r\n\r\nECS k8s service entity was missing the link to its corresponding\r\ndashboard\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798\">\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e\">\r\n\r\n\r\n### How to test\r\n\r\n- Start local kibana and es instances\r\n- run ` node scripts/synthtrace k8s_entities.ts --clean --live`\r\n- Navigate to Inventory and enable EEM\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"aead7b9acd5de0e5668c5f860eda473071a5a42d"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201260","number":201260,"mergeCommit":{"message":"[Inventory] Inventory k8s entities fixes (#201260)\n\ncloses [#201226](https://github.com/elastic/kibana/issues/201226)\r\n\r\n## Summary\r\n\r\nThis PR makes the final adjustments on k8s entities after the\r\nhttps://github.com//pull/196916 was merged.\r\n\r\nI had to fix most of the ECS entities because they had their `entityId`\r\ndefined with `uid` field. Most of the ECS K8s entities don't have this\r\nfield and should use the `name` field instead (see\r\n[metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41))\r\n\r\n~I also had to fix the transforms to include an aggregation for the\r\n`displayNameTemplate` field, when it doesn't match with the `entity.Id`~\r\n\r\n### Real data Otel\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nsending otel data\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17\">\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8\">\r\n\r\n### Real data ECS\r\n\r\nThe screenshots below are from a tests running the `opentemeletry-demo`\r\nwith elastic agent installed with Kubernetes integration\r\n\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1\">\r\n<img width=\"710\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b\">\r\n\r\n\r\n### Additional test with synthtrace\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8\">\r\n\r\n### Fix\r\n\r\nECS k8s service entity was missing the link to its corresponding\r\ndashboard\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798\">\r\n\r\n<img width=\"709\" alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e\">\r\n\r\n\r\n### How to test\r\n\r\n- Start local kibana and es instances\r\n- run ` node scripts/synthtrace k8s_entities.ts --clean --live`\r\n- Navigate to Inventory and enable EEM\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"aead7b9acd5de0e5668c5f860eda473071a5a42d"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Carlos Crespo <[email protected]>
closes [elastic#201226](elastic#201226) ## Summary This PR makes the final adjustments on k8s entities after the elastic#196916 was merged. I had to fix most of the ECS entities because they had their `entityId` defined with `uid` field. Most of the ECS K8s entities don't have this field and should use the `name` field instead (see [metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41)) ~I also had to fix the transforms to include an aggregation for the `displayNameTemplate` field, when it doesn't match with the `entity.Id`~ ### Real data Otel The screenshots below are from a tests running the `opentemeletry-demo` sending otel data <img width="710" alt="image" src="https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17"> <img width="710" alt="image" src="https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8"> ### Real data ECS The screenshots below are from a tests running the `opentemeletry-demo` with elastic agent installed with Kubernetes integration <img width="710" alt="image" src="https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1"> <img width="710" alt="image" src="https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b"> ### Additional test with synthtrace <img width="709" alt="image" src="https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8"> ### Fix ECS k8s service entity was missing the link to its corresponding dashboard <img width="709" alt="image" src="https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798"> <img width="709" alt="image" src="https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e"> ### How to test - Start local kibana and es instances - run ` node scripts/synthtrace k8s_entities.ts --clean --live` - Navigate to Inventory and enable EEM --------- Co-authored-by: Elastic Machine <[email protected]>
closes [elastic#201226](elastic#201226) ## Summary This PR makes the final adjustments on k8s entities after the elastic#196916 was merged. I had to fix most of the ECS entities because they had their `entityId` defined with `uid` field. Most of the ECS K8s entities don't have this field and should use the `name` field instead (see [metricsets](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html#_metricsets_41)) ~I also had to fix the transforms to include an aggregation for the `displayNameTemplate` field, when it doesn't match with the `entity.Id`~ ### Real data Otel The screenshots below are from a tests running the `opentemeletry-demo` sending otel data <img width="710" alt="image" src="https://github.com/user-attachments/assets/d223858d-3b99-4bb0-b69e-3b70112a2c17"> <img width="710" alt="image" src="https://github.com/user-attachments/assets/1ef27dcd-682c-4681-b92b-be9b4f2b32b8"> ### Real data ECS The screenshots below are from a tests running the `opentemeletry-demo` with elastic agent installed with Kubernetes integration <img width="710" alt="image" src="https://github.com/user-attachments/assets/e2fb6cbd-60a0-4995-bc94-8ccbc8911db1"> <img width="710" alt="image" src="https://github.com/user-attachments/assets/a3d9dba3-fee7-42af-972b-34a151b52f2b"> ### Additional test with synthtrace <img width="709" alt="image" src="https://github.com/user-attachments/assets/bf56da1e-0bbb-40a0-9f44-06b9f86427a8"> ### Fix ECS k8s service entity was missing the link to its corresponding dashboard <img width="709" alt="image" src="https://github.com/user-attachments/assets/488891a6-1c61-4001-b604-208478e1c798"> <img width="709" alt="image" src="https://github.com/user-attachments/assets/0b30c56b-db52-4d82-a7e7-100dae91a35e"> ### How to test - Start local kibana and es instances - run ` node scripts/synthtrace k8s_entities.ts --clean --live` - Navigate to Inventory and enable EEM --------- Co-authored-by: Elastic Machine <[email protected]>
closes #201226
Summary
This PR makes the final adjustments on k8s entities after the #196916 was merged.
I had to fix most of the ECS entities because they had their
entityId
defined withuid
field. Most of the ECS K8s entities don't have this field and should use thename
field instead (see metricsets)I also had to fix the transforms to include an aggregation for thedisplayNameTemplate
field, when it doesn't match with theentity.Id
Real data Otel
The screenshots below are from a tests running the
opentemeletry-demo
sending otel dataReal data ECS
The screenshots below are from a tests running the
opentemeletry-demo
with elastic agent installed with Kubernetes integrationAdditional test with synthtrace
Fix
ECS k8s service entity was missing the link to its corresponding dashboard
How to test
node scripts/synthtrace k8s_entities.ts --clean --live