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

[Infra][ECO] Adding summary API #194612

Merged
merged 12 commits into from
Oct 4, 2024

Conversation

cauemarcondes
Copy link
Contributor

@cauemarcondes cauemarcondes commented Oct 1, 2024

closes #193701

This PR does a few things:

  • Adds a new API endpoint on infra to fetch an entity summary: /api/infra/entities/{entityType}/{entityId}/summary. It fetches the latest EEM index filtering by entity.type(host | container) and depending on the entity type host.name or container.id. And it returns the following payload:
{
  "sourceDataStreams": [
    "logs",
    "metrics"
  ],
  "entityId": "caues-mbp",
  "entityType": "host"
}
  • Fix a problem on the Service entity definition removing the datastream.type and moving it to source_data_stream.type due to ECS conflicts.
  • Moves some common field definitions to observability-shared plugin, and updated APM and Inventory plugin.

@cauemarcondes cauemarcondes 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) v8.16.0 labels Oct 1, 2024
@cauemarcondes cauemarcondes marked this pull request as ready for review October 2, 2024 10:35
@cauemarcondes cauemarcondes requested review from a team as code owners October 2, 2024 10:35
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Oct 2, 2024
@elasticmachine
Copy link
Contributor

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

@kibana-ci
Copy link
Collaborator

kibana-ci commented Oct 3, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
inventory 239 238 -1

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
infra 23 24 +1
observabilityShared 479 487 +8
total +9

Async chunks

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

id before after diff
inventory 222.6KB 222.8KB +195.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 71.7KB 72.3KB +576.0B
Unknown metric groups

API count

id before after diff
infra 23 24 +1
observabilityShared 484 492 +8
total +9

History

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

Copy link
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Kibana.jsonc LGTM

@cauemarcondes cauemarcondes merged commit a91d007 into elastic:main Oct 4, 2024
31 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 4, 2024
closes elastic#193701

This PR does a few things:
- Adds a new API endpoint on infra to fetch an entity summary:
`/api/infra/entities/{entityType}/{entityId}/summary`. It fetches the
latest EEM index filtering by entity.type(host | container) and
depending on the entity type host.name or container.id. And it returns
the following payload:
```
{
  "sourceDataStreams": [
    "logs",
    "metrics"
  ],
  "entityId": "caues-mbp",
  "entityType": "host"
}
```
- Fix a problem on the `Service` entity definition removing the
`datastream.type` and moving it to `source_data_stream.type` due to ECS
conflicts.
- Moves some common field definitions to **observability-shared**
plugin, and updated APM and Inventory plugin.

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit a91d007)
@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

@cauemarcondes cauemarcondes deleted the infra-summary-api branch October 4, 2024 09:42
kibanamachine added a commit that referenced this pull request Oct 4, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Infra][ECO] Adding summary API
(#194612)](#194612)

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

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

<!--BACKPORT [{"author":{"name":"Cauê
Marcondes","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-04T08:46:54Z","message":"[Infra][ECO]
Adding summary API (#194612)\n\ncloses
https://github.com/elastic/kibana/issues/193701\r\n\r\nThis PR does a
few things:\r\n- Adds a new API endpoint on infra to fetch an entity
summary:\r\n`/api/infra/entities/{entityType}/{entityId}/summary`. It
fetches the\r\nlatest EEM index filtering by entity.type(host |
container) and\r\ndepending on the entity type host.name or
container.id. And it returns\r\nthe following payload:\r\n```\r\n{\r\n
\"sourceDataStreams\": [\r\n \"logs\",\r\n \"metrics\"\r\n ],\r\n
\"entityId\": \"caues-mbp\",\r\n \"entityType\":
\"host\"\r\n}\r\n```\r\n- Fix a problem on the `Service` entity
definition removing the\r\n`datastream.type` and moving it to
`source_data_stream.type` due to ECS\r\nconflicts.\r\n- Moves some
common field definitions to **observability-shared**\r\nplugin, and
updated APM and Inventory
plugin.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"a91d00731ae732c3bb2d370651048d94dd8adc2b","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","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.16.0"],"title":"[Infra][ECO]
Adding summary
API","number":194612,"url":"https://github.com/elastic/kibana/pull/194612","mergeCommit":{"message":"[Infra][ECO]
Adding summary API (#194612)\n\ncloses
https://github.com/elastic/kibana/issues/193701\r\n\r\nThis PR does a
few things:\r\n- Adds a new API endpoint on infra to fetch an entity
summary:\r\n`/api/infra/entities/{entityType}/{entityId}/summary`. It
fetches the\r\nlatest EEM index filtering by entity.type(host |
container) and\r\ndepending on the entity type host.name or
container.id. And it returns\r\nthe following payload:\r\n```\r\n{\r\n
\"sourceDataStreams\": [\r\n \"logs\",\r\n \"metrics\"\r\n ],\r\n
\"entityId\": \"caues-mbp\",\r\n \"entityType\":
\"host\"\r\n}\r\n```\r\n- Fix a problem on the `Service` entity
definition removing the\r\n`datastream.type` and moving it to
`source_data_stream.type` due to ECS\r\nconflicts.\r\n- Moves some
common field definitions to **observability-shared**\r\nplugin, and
updated APM and Inventory
plugin.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"a91d00731ae732c3bb2d370651048d94dd8adc2b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194612","number":194612,"mergeCommit":{"message":"[Infra][ECO]
Adding summary API (#194612)\n\ncloses
https://github.com/elastic/kibana/issues/193701\r\n\r\nThis PR does a
few things:\r\n- Adds a new API endpoint on infra to fetch an entity
summary:\r\n`/api/infra/entities/{entityType}/{entityId}/summary`. It
fetches the\r\nlatest EEM index filtering by entity.type(host |
container) and\r\ndepending on the entity type host.name or
container.id. And it returns\r\nthe following payload:\r\n```\r\n{\r\n
\"sourceDataStreams\": [\r\n \"logs\",\r\n \"metrics\"\r\n ],\r\n
\"entityId\": \"caues-mbp\",\r\n \"entityType\":
\"host\"\r\n}\r\n```\r\n- Fix a problem on the `Service` entity
definition removing the\r\n`datastream.type` and moving it to
`source_data_stream.type` due to ECS\r\nconflicts.\r\n- Moves some
common field definitions to **observability-shared**\r\nplugin, and
updated APM and Inventory
plugin.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"a91d00731ae732c3bb2d370651048d94dd8adc2b"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Cauê Marcondes <[email protected]>
tiansivive pushed a commit to tiansivive/kibana that referenced this pull request Oct 7, 2024
closes elastic#193701

This PR does a few things:
- Adds a new API endpoint on infra to fetch an entity summary:
`/api/infra/entities/{entityType}/{entityId}/summary`. It fetches the
latest EEM index filtering by entity.type(host | container) and
depending on the entity type host.name or container.id. And it returns
the following payload:
```
{
  "sourceDataStreams": [
    "logs",
    "metrics"
  ],
  "entityId": "caues-mbp",
  "entityType": "host"
}
```
- Fix a problem on the `Service` entity definition removing the
`datastream.type` and moving it to `source_data_stream.type` due to ECS
conflicts.
- Moves some common field definitions to **observability-shared**
plugin, and updated APM and Inventory plugin.

---------

Co-authored-by: kibanamachine <[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) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Infra][ECO] Create an API to detect if there is metrics data
9 participants