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

[8.x] [ECO][Inventory v2] Ad hoc data view: Add get entities definition endpoint using sources (#203424) #203861

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…point using sources (elastic#203424)

Closes elastic#202298
⚠️ Depends on elastic#203246

## Summary

This PR changes the way we get the entity index patterns to v2. It
creates an endpoint part of the inventory API which returns the index
patterns by entity type.

## Testing

⚠️ Currently in order to test we need to create the definition using the
dev tools manually before this
[PR](elastic#203246) is merged

- Open Dev tools and add a definition for an existing entity type
(example with host)
 ```
POST kbn:/internal/entities/v2/definitions/sources
{
  "source": {
    "id": "host_id",
    "type_id": "host",
    "index_patterns": ["metrics-*", "metricbeat-*"],
    "identity_fields": ["host.name"],
    "metadata_fields": [],
    "filters": [],
    "timestamp_field": "@timestamp"
  }
 ```

### Test the endpoint:
- Open Dev tools and add
` GET kbn:/internal/inventory/entity/definitions/sources?type=host `
- Response:
<img width="408" alt="image"
src="https://github.com/user-attachments/assets/1c7416b0-50a4-4e63-8081-928ec7856ff8">

### Test in the UI
- After the previous steps add some host data (oblt cluster /
metricbeat) or use synthtrace (for example use `node scripts/synthtrace
infra_hosts_with_apm_hosts --scenarioOpts.numInstances=10`)
- Go to Inventory and expand the host group
- Click on the actions button for any host and click on the Discover
link
- The correct dataview should be selected based on the created
definition
The same can be done for other entity types

https://github.com/user-attachments/assets/c9c3a7ae-daff-4d4b-b1b7-898c3f1603c6

---------

Co-authored-by: Carlos Crespo <[email protected]>
(cherry picked from commit 5bacf1f)
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!)

@elasticmachine
Copy link
Contributor

⏳ Build in-progress

  • Buildkite Build
  • Commit: 723da0a
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-203861-723da0a86ba7

Failed CI Steps

cc @jennypavlova

@kibanamachine kibanamachine merged commit 82d1f7a into elastic:8.x Dec 11, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport ci:project-deploy-observability Create an Observability project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants