Skip to content
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

Merged

Conversation

crespocarlos
Copy link
Contributor

@crespocarlos crespocarlos commented Nov 21, 2024

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 with uid field. Most of the ECS K8s entities don't have this field and should use the name field instead (see metricsets)

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

image image

Real data ECS

The screenshots below are from a tests running the opentemeletry-demo with elastic agent installed with Kubernetes integration

image image

Additional test with synthtrace

image

Fix

ECS k8s service entity was missing the link to its corresponding dashboard

image image

How to test

  • Start local kibana and es instances
  • run node scripts/synthtrace k8s_entities.ts --clean --live
  • Navigate to Inventory and enable EEM

@crespocarlos
Copy link
Contributor Author

/ci

@crespocarlos crespocarlos force-pushed the 201226-adjustments-k8s-entities branch from 3284ad5 to 7900589 Compare November 22, 2024 10:23
@crespocarlos crespocarlos added release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:obs-entities Observability Entities Team backport:version Backport to applied version labels v8.17.0 backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Nov 22, 2024
@crespocarlos crespocarlos marked this pull request as ready for review November 22, 2024 10:31
@crespocarlos crespocarlos requested review from a team as code owners November 22, 2024 10:31
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-entities (Team:obs-entities)

@miltonhultgren
Copy link
Contributor

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

Copy link
Contributor

@miltonhultgren miltonhultgren left a 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.

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Nov 22, 2024
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@crespocarlos
Copy link
Contributor Author

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.

@miltonhultgren I think we still need to look into this. cc: @roshan-elastic

if (!definition.metadata) {
return '';
}
const displayNameField = definition.displayNameTemplate.replace(/[{}]/g, '');
Copy link
Contributor

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}}

Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klacabane fixed here: 2bb2e1e

@roshan-elastic
Copy link

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.

@miltonhultgren I think we still need to look into this. cc: @roshan-elastic

Good catch both.

I'm thinking that we could:

  • Concat the two fields as a means to not accidentally merging data across two pods with the same UID but in different clusters.
  • Store the pod UID as a metadata field
  • Keep the display name as the pod name

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?

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@roshan-elastic
Copy link

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.

@miltonhultgren I think we still need to look into this. cc: @roshan-elastic

Good catch both.

I'm thinking that we could:

  • Concat the two fields as a means to not accidentally merging data across two pods with the same UID but in different clusters.
  • Store the pod UID as a metadata field
  • Keep the display name as the pod name

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?

Quick Q on this @crespocarlos - I assume the above hasn't gone into the PR (and might be a valid follow up issue)?

@crespocarlos
Copy link
Contributor Author

crespocarlos commented Nov 22, 2024

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.

@roshan-elastic
Copy link

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.

@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 25, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: 0a111e7
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-201260-0a111e7ec539

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/apm-synthtrace-client 268 270 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
infra 1.8MB 1.8MB +27.0B
inventory 236.3KB 236.5KB +174.0B
total +201.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observabilityShared 93.7KB 93.7KB +15.0B
Unknown metric groups

API count

id before after diff
@kbn/apm-synthtrace-client 268 270 +2

History

@crespocarlos crespocarlos added the backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) label Nov 26, 2024
@crespocarlos crespocarlos merged commit aead7b9 into elastic:main Nov 26, 2024
30 checks passed
@crespocarlos crespocarlos deleted the 201226-adjustments-k8s-entities branch November 26, 2024 08:29
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.x

https://github.com/elastic/kibana/actions/runs/12026661303

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 26, 2024
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)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 26, 2024
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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.17
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 26, 2024
# 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]>
kibanamachine added a commit that referenced this pull request Nov 26, 2024
# 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]>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
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]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) backport:version Backport to applied version labels ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-entities Observability Entities Team Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Inventory] Test Inventory with real k8s data
7 participants