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

[EEM] Add built in definitions for hosts and containers #193157

Conversation

miltonhultgren
Copy link
Contributor

@miltonhultgren miltonhultgren commented Sep 17, 2024

Summary

This PR adds built in definitions for hosts and containers based on ECS data.

How to test

  1. Check out this branch of Kibana
  2. Start ES and Kibana, verify that start up works and that the two definitions are installed (by calling GET /internal/entities/definition or checking that the transforms are installed).
  3. Ingest some data for each definition to work with, verify that you get data in entities-host-* and entities-container-* and that the data matches the expected shape (metadata and metrics[1])

[1]

@miltonhultgren miltonhultgren added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Feature:EEM Elastic Entity Model labels Sep 17, 2024
@miltonhultgren miltonhultgren requested a review from a team as a code owner September 17, 2024 12:29
@obltmachine
Copy link

🤖 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!)

@miltonhultgren
Copy link
Contributor Author

@roshan-elastic @smith @cauemarcondes Here is the PR to add the two new definitions.

One question I have though, do you still want to include the metrics in version 1.0.0 if you don't plan to use them yet or should I drop them and you can add them later when you are ready to consume that data?

@roshan-elastic
Copy link

Thanks @miltonhultgren

One question I have though, do you still want to include the metrics in version 1.0.0 if you don't plan to use them yet or should I drop them and you can add them later when you are ready to consume that data?

@smith - I don't mind them being in the indices as long as it doesn't add a burden to our team that we don't want? We won't be showing them in Inventory but I'm happy for them to be there (we get feedback from users if they click through to Discover).

WDYT?

@miltonhultgren
Copy link
Contributor Author

Do consider that adding metrics does increase the compute and storage cost of the definition (which long term I imagine we'll need to justify, of course, but perhaps it is wise to defer it until later).
Is it likely that users will see it in Discover and use it for some problem solution?

@roshan-elastic
Copy link

Do consider that adding metrics does increase the compute and storage cost of the definition (which long term I imagine we'll need to justify, of course, but perhaps it is wise to defer it until later).

I'll defer to @chrisdistasio on this aspect. If he's OK with it, I am (from a PM perspective).

Is it likely that users will see it in Discover and use it for some problem solution?

We don't know really. Sometimes putting something in the hands of users and seeing what they do is the best way to find out! It's basically cheap discovery.

Copy link
Contributor

@smith smith left a comment

Choose a reason for hiding this comment

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

I have some suggestions here but in general this looks ok to merge.

As long as we're assuming Elastic-specific ECS data these match the data models of existing Elastic apps.

Are we planning on having additional entity definitions later on for otel-native schemas of these entity types (Host for example?)

type: 'container',
indexPatterns: ['filebeat-*', 'logs-*', 'metrics-*', 'metricbeat-*'],
identityFields: ['container.id'],
displayNameTemplate: '{{container.id}}',
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be container.name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@miltonhultgren
Copy link
Contributor Author

miltonhultgren commented Sep 18, 2024

Are we planning on having additional entity definitions later on for otel-native schemas of these entity types (Host for example?)

I don't know, I would defer to @chrisdistasio to speak to the plans for the EEM team.

To share my 2 cents though:
If the ECO team wants to extract host entities from SemConv data then you should feel free to submit a PR that adds such a built in (as done in this simple PR) or find a way for the OTEL agent to install such a definition (similar to what we'll do for Kubernetes via the Integrations).

I don't believe it is productive for the EEM team to create and maintain specific definitions.
I believe we should focus our time on making sure your team has the tools to extract the data in the way you need to.
Similar to the split between Beats core and Beats modules.

@miltonhultgren
Copy link
Contributor Author

@roshan-elastic @chrisdistasio FYI I think it's okay to leave them in for now (similar for the service built in definition), we need to decide on if we will descope the current metrics features and will treat that as a follow up once we decide on where we want to go.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

{
name: 'A',
aggregation: 'doc_count',
filter: 'log.level: * OR error.log.level: *',
Copy link
Contributor

Choose a reason for hiding this comment

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

indexPatterns: ['filebeat-*', 'logs-*', 'metrics-*', 'metricbeat-*'],
identityFields: ['host.name'],
displayNameTemplate: '{{host.name}}',
history: {
Copy link
Contributor

Choose a reason for hiding this comment

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

@miltonhultgren miltonhultgren merged commit 26a50f7 into elastic:main Sep 18, 2024
19 checks passed
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 30, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 193157 locally

2 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 193157 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add the label auto-backport or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 193157 locally

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 193157 locally

@klacabane klacabane removed the backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) label Oct 4, 2024
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 4, 2024
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Oct 4, 2024
@klacabane klacabane added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed backport:skip This commit does not require backporting labels Oct 4, 2024
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

miltonhultgren added a commit to kibanamachine/kibana that referenced this pull request Oct 7, 2024
…c#193157)

This PR adds built in definitions for `hosts` and `containers` based on
ECS data.

1. Check out this branch of Kibana
2. Start ES and Kibana, verify that start up works and that the two
definitions are installed (by calling `GET
/internal/entities/definition` or checking that the transforms are
installed).
3. Ingest some data for each definition to work with, verify that you
get data in `entities-host-*` and `entities-container-*` and that the
data matches the expected shape (metadata and metrics[1])

[[1]](elastic#193157 (comment))
kibanamachine added a commit that referenced this pull request Oct 7, 2024
… (#194921)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[EEM] Add built in definitions for hosts and containers
(#193157)](#193157)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Milton
Hultgren","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-18T14:03:17Z","message":"[EEM]
Add built in definitions for hosts and containers (#193157)\n\n###
Summary\r\n\r\nThis PR adds built in definitions for `hosts` and
`containers` based on\r\nECS data.\r\n\r\n### How to test\r\n\r\n1.
Check out this branch of Kibana\r\n2. Start ES and Kibana, verify that
start up works and that the two\r\ndefinitions are installed (by calling
`GET\r\n/internal/entities/definition` or checking that the transforms
are\r\ninstalled).\r\n3. Ingest some data for each definition to work
with, verify that you\r\nget data in `entities-host-*` and
`entities-container-*` and that the\r\ndata matches the expected shape
(metadata and
metrics[1])\r\n\r\n\r\n[[1]](https://github.com/elastic/kibana/pull/193157#issuecomment-2355609821)","sha":"26a50f71562ad713903e8543b7793f482f717935","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Feature:EEM"],"title":"[EEM]
Add built in definitions for hosts and
containers","number":193157,"url":"https://github.com/elastic/kibana/pull/193157","mergeCommit":{"message":"[EEM]
Add built in definitions for hosts and containers (#193157)\n\n###
Summary\r\n\r\nThis PR adds built in definitions for `hosts` and
`containers` based on\r\nECS data.\r\n\r\n### How to test\r\n\r\n1.
Check out this branch of Kibana\r\n2. Start ES and Kibana, verify that
start up works and that the two\r\ndefinitions are installed (by calling
`GET\r\n/internal/entities/definition` or checking that the transforms
are\r\ninstalled).\r\n3. Ingest some data for each definition to work
with, verify that you\r\nget data in `entities-host-*` and
`entities-container-*` and that the\r\ndata matches the expected shape
(metadata and
metrics[1])\r\n\r\n\r\n[[1]](https://github.com/elastic/kibana/pull/193157#issuecomment-2355609821)","sha":"26a50f71562ad713903e8543b7793f482f717935"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193157","number":193157,"mergeCommit":{"message":"[EEM]
Add built in definitions for hosts and containers (#193157)\n\n###
Summary\r\n\r\nThis PR adds built in definitions for `hosts` and
`containers` based on\r\nECS data.\r\n\r\n### How to test\r\n\r\n1.
Check out this branch of Kibana\r\n2. Start ES and Kibana, verify that
start up works and that the two\r\ndefinitions are installed (by calling
`GET\r\n/internal/entities/definition` or checking that the transforms
are\r\ninstalled).\r\n3. Ingest some data for each definition to work
with, verify that you\r\nget data in `entities-host-*` and
`entities-container-*` and that the\r\ndata matches the expected shape
(metadata and
metrics[1])\r\n\r\n\r\n[[1]](https://github.com/elastic/kibana/pull/193157#issuecomment-2355609821)","sha":"26a50f71562ad713903e8543b7793f482f717935"}}]}]
BACKPORT-->

Co-authored-by: Milton Hultgren <[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) Feature:EEM Elastic Entity Model release_note:skip Skip the PR/issue when compiling release notes v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants