-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: minimal topology details for rest of the children #288
Conversation
@adityathebe can we add some tests for this ? |
d6ec92a
to
921d0f9
Compare
* fetch other columns that are essential to create the tree
921d0f9
to
0d52441
Compare
topology.go
Outdated
// parents, incidents, analysis, checks columns need to fetched to create the topology tree even though they may not be essential to the UI. | ||
return "name, namespace, id, is_leaf, status, status_reason, summary, topology_type, labels, team_names, agent_id, parent_id, type, parents, incidents, analysis, checks" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moshloop had to add back these columns as they're essential during tree creation.
- parents
- incidents
- analysis
- checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure how much better this will perform - I also think we should use more sql functions / views and have this in a single db query rather than multiple trips to the db.
Generally I think there are phases:
- Find all top level components (no parents, or direct descendants) and apply label, type, team, agent filters at this level only.
- For each component summarize health, incidents, analysis of its descendants
// find all the descendants of a component, including those via relationships
find_descendants(id): returns id array
descendants = find_descendants(id)
select components.* from components where filters
with each top level component
select name, id, parent, type, icon, component_summary.* from components where id in @descandents
inner join component_summary
where component_summary is a view, that maybe becomes a materialized view in the future (which is refreshed on a debonce(check.transitioned, analysis.updated, incident.transitioned) etc..
- Union and then post process for top-level summary in go
- strip off parent(s), agent_id in final topology returned
wdyt @yashmehrotra ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with point 1 of applying filters just at top level
for point 2, are we selecting all the descendants or just summarizing them ? cause summary right now happens in go not sql, so we might want to change that
aa0fc9b
to
1994920
Compare
Resolves: #285