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

Extract hosts/pods/containers/services assets #1

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

klacabane
Copy link
Collaborator

@klacabane klacabane commented Apr 27, 2023

Summary

Closes elastic/kibana#155870

The change introduces asset-scoped queries for hosts, pods, containers and services. Each query is responsible for building documents of a single type and setting relationships found in the documents metadata. The queries are only building assets of the concerned type and not the related ones; for example if host document contains pod metadata, the host logic will set the pod ean as a child, but leave the pod asset creation to the pod logic. This may create dangling references but keeps the post processing of each query simple, and can be updated later if needed.

Testing

  • setup clusters in config.json (I used edge-oblt as source and local es as dest)
  • run npx ts-node run.ts --read=<source> --write=<dest>
  • 4 types of assets should be inserted in assets-* data streams
  • one can use assets-manager API to get results of random assets (eg GET kbn:/api/asset-manager/assets/related?relation=ancestors&from=2023-05-05T00:00:00.000Z&ean=service:emailService&maxDistance=3)

@klacabane klacabane changed the title Extract hosts assets Extract hosts/pods/containers/services assets May 2, 2023
lib/collectServices.ts Outdated Show resolved Hide resolved
lib/collectServices.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Asset Manager] Extract host assets from metrics
2 participants