-
Notifications
You must be signed in to change notification settings - Fork 11
Trace drilldown to explorer screen #1098
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
Trace drilldown to explorer screen #1098
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1098 +/- ##
==========================================
+ Coverage 85.08% 85.18% +0.09%
==========================================
Files 825 825
Lines 17066 17082 +16
Branches 2216 2216
==========================================
+ Hits 14521 14551 +30
+ Misses 2514 2500 -14
Partials 31 31
Continue to review full report at Codecov.
|
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.
only commented on one, but they apply in both places
<ng-container | ||
*ngIf="this.getExploreNavigationParams(traceDetails.traceId) | async as exploreNavigationParams" | ||
> | ||
<ht-link class="link" [paramsOrUrl]="exploreNavigationParams"> |
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.
Could you add a screenshot of what this looks like after the change? Specifically, I'm looking for what this looks like vs what it would look like to use ExploreFilterLinkComponent
instead of htLink directly.
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.
got it, thanks - I think for consistency, it would make since to use the filter link here. It also gives a visual indicator, without requiring a hover, that it's actionable.
Something like:
<ht-explore-filter-link [paramsOrUrl]="this.getExploreNavigationParams(traceDetails.traceId) | async"
<ht-summary-value
class="summary-value"
icon="${IconType.TraceId}"
label="Trace ID"
[value]="traceDetails.traceId">
</ht-summary-value>
</ht-explore-filter-link>
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.
Yep, I thought we recommended ht-explore-filter-link
only. It is same as ht-link but it brings in an icon at the end that indicates the user what type of link it is.
></ht-summary-value> | ||
|
||
<ng-container | ||
*ngIf="this.getExploreNavigationParams(traceDetails.traceId) | async as exploreNavigationParams" |
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.
1 nit, 1 major here:
nit - the ngIf can move down onto the link, the extra container is unnecessary.
major - calling a function to return an observable will return a new observable each time - so every cycle will be treated as a change from the async pipe's perspective. Instead, you can either assign the observable to a variable and reference that here, or use htMemoize
pipe before the async one. My guess is the former will be clearer rather than chaining pipes.
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.
+1. @jyothishjose6190 since traceDetails
itself is coming from an observable,htMemoize
would be super useful here. It would only call the method if the parameter object changes. You will find few existing examples in the product.
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.
Both this comment and the one about the link component came up in the PR to add this support on span attributes, so you could use that PR as a reference too (although there, the decision was made for styling reasons to keep the filter link and value rendered separately - not sure if the same applies here):
label="Trace ID" | ||
[value]="traceDetails.id" | ||
></ht-summary-value> | ||
<ng-container *ngIf="this.getExploreNavigationParams(traceDetails.id) | async as exploreNavigationParams"> |
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.
Same changes here
@aaron-steinfeld @anandtiwary made changes. please review |
@@ -82,4 +92,9 @@ export class TraceDetailPageComponent { | |||
public onClickBack(): void { | |||
this.navigationService.navigateBack(); | |||
} | |||
|
|||
public getExplorerNavigationParams = (traceDetails: ApiTraceDetails | undefined): Observable<NavigationParams> => |
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.
This is a full trace, but also doesn't appear like it can ever be called with undefined.
public getExplorerNavigationParams = (traceDetails: ApiTraceDetails | undefined): Observable<NavigationParams> => | |
public getExplorerNavigationParams = (traceDetails: TraceDetails): Observable<NavigationParams> => |
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.
+1
LabelModule, | ||
TracingDashboardModule, | ||
IconModule, | ||
SummaryValueModule, | ||
LinkModule, |
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.
link no longer used
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.
please remove it
@@ -86,4 +96,9 @@ export class ApiTraceDetailPageComponent { | |||
public navigateToFullTrace(traceId: string, startTime: string): void { | |||
this.navigationService.navigateWithinApp(['/trace', traceId, { startTime: startTime }]); | |||
} | |||
|
|||
public getExplorerNavigationParams = (traceDetails: ApiTraceDetails | undefined): Observable<NavigationParams> => |
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.
public getExplorerNavigationParams = (traceDetails: ApiTraceDetails | undefined): Observable<NavigationParams> => | |
public getExplorerNavigationParams = (traceDetails: ApiTraceDetails): Observable<NavigationParams> => |
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.
+1
<ht-explore-filter-link | ||
class="filter-link" | ||
[paramsOrUrl]="getExploreNavigationParams | htMemoize: this.selectedData | async" | ||
htTooltip="See traces in Explorer" |
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.
it looks like this is going to see spans, not traces
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.
@jyothishjose6190 Please update this.
mockProvider(OverlayService), | ||
mockProvider(ExplorerService) | ||
], | ||
declarations: [MockComponent(WaterfallChartComponent), MockComponent(ExploreFilterLinkComponent)] |
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.
Can we add some tests for this? (and in the other components)
@anandtiwary @aaron-steinfeld please review this |
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.
Instead of doing this
<ht-explore-filter-link
class="filter-link"
[paramsOrUrl]="getExplorerNavigationParams | htMemoize: traceDetails | async"
htTooltip="See traces in Explorer"
>
<ht-summary-value
class="summary-value"
icon="${IconType.TraceId}"
label="Trace ID"
[value]="traceDetails.traceId"
></ht-summary-value>
</ht-explore-filter-link>
Please do this similar to this at all the places, with appropriate CSS
<div class="filterable-summary-value">
<ht-summary-value
class="summary-value"
icon="${IconType.TraceId}"
label="Trace ID"
[value]="traceDetails.traceId"
></ht-summary-value>
<ht-explore-filter-link
class="filter-link"
[paramsOrUrl]="getExplorerNavigationParams | htMemoize: traceDetails | async"
htTooltip="See traces in Explorer"
>
</ht-explore-filter-link>
</div>
The first approach is creating some issues (like 2 tooltips for spans etc and it also doesn't look good). I think the behaviour should be similar like other place where we click on the filter button and then we filter things.
So conceptually, the first approach is better. The whole idea of a filter link component accepting content is exactly this. If it doesn't look good or has duplicate tooltips (is this because the component already has a tooltip and we're adding a second one here?), I'd say we should fix that. |
But the problem I see with the current approach is, we have IMO, The filter icon should only be responsible to click and filter, rather than whole component(content inside it) |
Also on other screens, we have the same functionality. Clicking on the filter icon alone will apply the filter. I think the second approach suggested by @itssharmasandeep, matches the implementations in other screens |
So purely talking from a UX perspective, the behavior I'd expect for the code above ( If that's not how the filter link component behaves today, we should probably change that but it doesn't need to be part of this PR. The main goal is consistency in UX, consistency in code can follow after. |
I completely agree with you on this, when I was working on tag search then I implemented this hover effect (but not a part of filter link component) and it is not there inside it currently. |
Yep, either way works for me. Doing it in this PR is probably quicker, but is a scope increase - but given its only used in one other spot that I see, not a significant one.
I could not for the life of me figure out how that was working... turns out I haven't pulled in weeks and was comparing a UI with your changes and code without :( |
@aaron-steinfeld @itssharmasandeep please review |
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.
It looks good to me, works fine as well, as expected.
@jyothishjose6190 let @aaron-steinfeld also review then we can merge this
Screen.Recording.2021-09-24.at.3.13.51.PM.mov
Enables the user to click on a trace ID and view the explorer screen with filters applied
Testing
All tests passed
Checklist: