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] Create an API to detect if there is metrics data #193701

Closed
crespocarlos opened this issue Sep 23, 2024 · 1 comment · Fixed by #194612
Closed

[Infra][ECO] Create an API to detect if there is metrics data #193701

crespocarlos opened this issue Sep 23, 2024 · 1 comment · Fixed by #194612
Assignees
Labels
enhancement New value added to drive a business result Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team

Comments

@crespocarlos
Copy link
Contributor

crespocarlos commented Sep 23, 2024

Summary

Important

WIP
TODO: Determine if we need to query EEM for this - It's not mandatory to meet what the epic asks because we won't implement an adaptive view for logs-only entities on the Asset Details UI at this moment

Create an API that will return whether there is metrics data for entities supported by the Asset details (hosts and containers)

Endpoint

GET infra/entities/{entityType}/{entityId}/summary

Response

{
   sourceDataStreams: Array<'logs'|'metrics'> | [], // this will help extending the response to return EEM data
   entityId: string,
   entityType: 'host' | 'container'
}

AC

  • The query should check if there is data in the metrics-* indices for the entity example here [@cauemarcondes] I decided to query the latest index since will use it very soon to start showing log rate when an entity type host/container has logs only data.
    • it should return sourceDataStreams: ['metrics'] if data is found
    • it should return sourceDataStreams: [] if there is no data
@crespocarlos crespocarlos self-assigned this Sep 23, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Sep 23, 2024
@crespocarlos crespocarlos added needs-refinement A reason and acceptance criteria need to be defined for this issue Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Sep 23, 2024
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs-team Issues missing a team label label Sep 23, 2024
@crespocarlos crespocarlos added the enhancement New value added to drive a business result label Sep 23, 2024
@crespocarlos crespocarlos changed the title [Infra][ECO] Create API to detect if there is metrics data [Infra][ECO] Create an API to detect if there is metrics data Sep 23, 2024
@crespocarlos crespocarlos removed the needs-refinement A reason and acceptance criteria need to be defined for this issue label Oct 3, 2024
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue 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)
tiansivive pushed a commit to tiansivive/kibana that referenced this issue 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
enhancement New value added to drive a business result Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants