Skip to content

feat: add navigation handling for inactive entities #815

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

Merged
merged 9 commits into from
May 5, 2021

Conversation

jake-bassett
Copy link
Contributor

Description

This change allows navigation routes to know when an entity is inactive so it can be routed differently if needed.

@jake-bassett jake-bassett requested a review from a team as a code owner May 3, 2021 22:44
@codecov
Copy link

codecov bot commented May 3, 2021

Codecov Report

Merging #815 (85604f8) into main (8440694) will decrease coverage by 0.00%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #815      +/-   ##
==========================================
- Coverage   85.44%   85.44%   -0.01%     
==========================================
  Files         792      792              
  Lines       16199    16212      +13     
  Branches     2071     2073       +2     
==========================================
+ Hits        13841    13852      +11     
- Misses       2327     2329       +2     
  Partials       31       31              
Impacted Files Coverage Δ
...ervability/src/shared/constants/entity-metadata.ts 100.00% <ø> (ø)
...table/data-cell/entity/entity-table-cell-parser.ts 72.72% <80.00%> (-2.28%) ⬇️
...ata-cell/entity/entity-table-cell-renderer-util.ts 81.25% <88.88%> (+9.82%) ⬆️
...nents/entity-renderer/entity-renderer.component.ts 100.00% <100.00%> (ø)
...ell/entity/entity-table-cell-renderer.component.ts 100.00% <100.00%> (ø)
...ces/navigation/entity/entity-navigation.service.ts 95.83% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8440694...85604f8. Read the comment docs.

@github-actions

This comment has been minimized.

@@ -27,3 +30,22 @@ export const parseEntityFromTableRow = (cell: Entity | undefined, row: Dictionar
};

const isInteraction = (neighbor: unknown): neighbor is Interaction => typeof neighbor === 'object';

export const isInactiveEntity = (row: TableRow): boolean | undefined => {
const maxEndTimeAggregation = row['max(endTime)']; // Ew.
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems... ripe for improvement. Unless we change the api to pass this info in (which wouldn't be a bad idea but likely won't happen immediately), a better heuristic for an inactive entity that avoids looking at any particular field which may or may not be requested/exist on all entities would be to check:

  1. The entity includes at least one metric AND
  2. All metrics fetched are undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this is really really ugly. I felt better putting it in this file which already holds some ugly Entity handling code. At least it is all isolated.

Talked with the backend folks about which heuristic to use here. Checking that max(endTime) is a valid number is the most solid way to know for sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Talked with the backend folks about which heuristic to use here. Checking that max(endTime) is a valid number is the most solid way to know for sure.

See above - max(endTime) is a specific subset of the general heuristic I described which allows us to remove any coupling to a specific usage. No metric will be available for an inactive entity, so it just limits us to pick one to check.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…ntity/entity-table-cell-renderer-util.ts

Co-authored-by: Aaron Steinfeld <[email protected]>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@jake-bassett jake-bassett requested a review from a team May 5, 2021 00:19
public onClickNavigate(): void {
this.navigable && this.entity && this.entityNavService.navigateToEntity(this.entity);
this.navigable && this.entity && this.entityNavService.navigateToEntity(this.entity, this.inactive);
Copy link
Contributor

Choose a reason for hiding this comment

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

What does inactive do? why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If an entity is inactive, it means we haven't seen any spans in the time range. Therefore, some of the screens won't show any data available and we may want to navigate to alternative pages instead for those APIs when drilled in to.

Copy link
Contributor

Choose a reason for hiding this comment

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

So is it same as under discovery entity?
The name is not clear honestly. navigationFunction(entityId, sourceRoute, isInactive) i guess this alternate url would be defined in the entity map?

@jake-bassett jake-bassett merged commit 58e2cd8 into main May 5, 2021
@jake-bassett jake-bassett deleted the endpoint-list-drilldown branch May 5, 2021 20:21
@github-actions
Copy link

github-actions bot commented May 5, 2021

Unit Test Results

    4 files  ±0  250 suites  ±0   14m 55s ⏱️ +11s
897 tests ±0  897 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
903 runs  ±0  903 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 58e2cd8. ± Comparison against base commit 8440694.

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.

3 participants