Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { IconType } from '@hypertrace/assets-library';
import { NavigationService, SubscriptionLifecycle } from '@hypertrace/common';
import { ButtonRole, ButtonStyle, IconSize } from '@hypertrace/components';
import { NavigationParams, NavigationService, SubscriptionLifecycle } from '@hypertrace/common';
import { ButtonRole, ButtonStyle, FilterOperator, IconSize } from '@hypertrace/components';
import { Observable } from 'rxjs';
import { LogEvent } from '../../shared/dashboard/widgets/waterfall/waterfall/waterfall-chart';
import { ExplorerService } from '../explorer/explorer-service';
import { ScopeQueryParam } from '../explorer/explorer.component';
import { ApiTraceDetails, ApiTraceDetailService } from './api-trace-detail.service';

@Component({
Expand Down Expand Up @@ -31,12 +33,19 @@ import { ApiTraceDetails, ApiTraceDetailService } from './api-trace-detail.servi
icon="${IconType.Time}"
[value]="traceDetails.timeString"
></ht-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-summary-value
class="summary-value"
icon="${IconType.TraceId}"
label="Trace ID"
[value]="traceDetails.traceId"
></ht-summary-value>
</ht-explore-filter-link>

<div class="separation"></div>

Expand Down Expand Up @@ -73,7 +82,8 @@ export class ApiTraceDetailPageComponent {

public constructor(
protected readonly navigationService: NavigationService,
private readonly apiTraceDetailService: ApiTraceDetailService
private readonly apiTraceDetailService: ApiTraceDetailService,
private readonly explorerService: ExplorerService
) {
this.traceDetails$ = this.apiTraceDetailService.fetchTraceDetails();
this.logEvents$ = this.apiTraceDetailService.fetchLogEvents();
Expand All @@ -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> =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public getExplorerNavigationParams = (traceDetails: ApiTraceDetails | undefined): Observable<NavigationParams> =>
public getExplorerNavigationParams = (traceDetails: ApiTraceDetails): Observable<NavigationParams> =>

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

this.explorerService.buildNavParamsWithFilters(ScopeQueryParam.EndpointTraces, [
{ field: 'traceId', operator: FilterOperator.Equals, value: traceDetails!.traceId }
]);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FormattingModule, HtRoute } from '@hypertrace/common';
import { FormattingModule, HtRoute, MemoizeModule } from '@hypertrace/common';
import {
ButtonModule,
CopyShareableLinkToClipboardModule,
Expand All @@ -11,6 +11,7 @@ import {
NavigableTabModule,
SummaryValueModule
} from '@hypertrace/components';
import { ExploreFilterLinkModule } from '../../shared/components/explore-filter-link/explore-filter-link.module';
import { LogEventsTableModule } from '../../shared/components/log-events/log-events-table.module';
import { NavigableDashboardModule } from '../../shared/dashboard/dashboard-wrapper/navigable-dashboard.module';
import { ObservabilityDashboardModule } from '../../shared/dashboard/observability-dashboard.module';
Expand Down Expand Up @@ -51,8 +52,10 @@ const ROUTE_CONFIG: HtRoute[] = [
IconModule,
SummaryValueModule,
LoadAsyncModule,
MemoizeModule,
FormattingModule,
ButtonModule,
ExploreFilterLinkModule,
CopyShareableLinkToClipboardModule,
NavigableTabModule,
LogEventsTableModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { IconType } from '@hypertrace/assets-library';
import { NavigationService, SubscriptionLifecycle } from '@hypertrace/common';
import { IconSize } from '@hypertrace/components';
import { NavigationParams, NavigationService, SubscriptionLifecycle } from '@hypertrace/common';
import { FilterOperator, IconSize } from '@hypertrace/components';
import { Observable } from 'rxjs';
import { LogEvent } from '../../shared/dashboard/widgets/waterfall/waterfall/waterfall-chart';
import { ApiTraceDetails } from '../api-trace-detail/api-trace-detail.service';
import { ExplorerService } from '../explorer/explorer-service';
import { ScopeQueryParam } from '../explorer/explorer.component';
import { TraceDetails, TraceDetailService } from './trace-detail.service';
@Component({
styleUrls: ['./trace-detail.page.component.scss'],
Expand All @@ -30,12 +33,18 @@ import { TraceDetails, TraceDetailService } from './trace-detail.service';
icon="${IconType.Time}"
[value]="traceDetails.timeString"
></ht-summary-value>
<ht-summary-value
class="summary-value"
icon="${IconType.TraceId}"
label="Trace ID"
[value]="traceDetails.id"
></ht-summary-value>
<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.id"
></ht-summary-value>
</ht-explore-filter-link>

<div class="separation"></div>

Expand Down Expand Up @@ -72,7 +81,8 @@ export class TraceDetailPageComponent {

public constructor(
private readonly navigationService: NavigationService,
private readonly traceDetailService: TraceDetailService
private readonly traceDetailService: TraceDetailService,
private readonly explorerService: ExplorerService
) {
this.traceDetails$ = this.traceDetailService.fetchTraceDetails();
this.exportSpans$ = this.traceDetailService.fetchExportSpans();
Expand All @@ -82,4 +92,9 @@ export class TraceDetailPageComponent {
public onClickBack(): void {
this.navigationService.navigateBack();
}

public getExplorerNavigationParams = (traceDetails: ApiTraceDetails | undefined): Observable<NavigationParams> =>
Copy link
Contributor

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.

Suggested change
public getExplorerNavigationParams = (traceDetails: ApiTraceDetails | undefined): Observable<NavigationParams> =>
public getExplorerNavigationParams = (traceDetails: TraceDetails): Observable<NavigationParams> =>

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

this.explorerService.buildNavParamsWithFilters(ScopeQueryParam.EndpointTraces, [
{ field: 'traceId', operator: FilterOperator.Equals, value: traceDetails!.id }
]);
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { FormattingModule, HtRoute } from '@hypertrace/common';
import { FormattingModule, HtRoute, MemoizeModule } from '@hypertrace/common';
import {
CopyShareableLinkToClipboardModule,
DownloadJsonModule,
IconModule,
LabelModule,
LinkModule,
LoadAsyncModule,
NavigableTabModule,
SummaryValueModule,
TooltipModule
} from '@hypertrace/components';
import { ExploreFilterLinkModule } from '../../shared/components/explore-filter-link/explore-filter-link.module';
import { LogEventsTableModule } from '../../shared/components/log-events/log-events-table.module';
import { NavigableDashboardModule } from '../../shared/dashboard/dashboard-wrapper/navigable-dashboard.module';
import { TracingDashboardModule } from '../../shared/dashboard/tracing-dashboard.module';
Expand Down Expand Up @@ -47,10 +49,13 @@ const ROUTE_CONFIG: HtRoute[] = [
imports: [
RouterModule.forChild(ROUTE_CONFIG),
CommonModule,
ExploreFilterLinkModule,
LabelModule,
TracingDashboardModule,
IconModule,
SummaryValueModule,
LinkModule,
Copy link
Contributor

Choose a reason for hiding this comment

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

link no longer used

Copy link
Contributor

Choose a reason for hiding this comment

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

please remove it

MemoizeModule,
TooltipModule,
LoadAsyncModule,
FormattingModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { MemoizeModule } from '@hypertrace/common';
import { LoadAsyncModule, OverlayService } from '@hypertrace/components';
import { mockDashboardWidgetProviders } from '@hypertrace/dashboards/testing';
import { createComponentFactory, mockProvider } from '@ngneat/spectator/jest';
import { MockComponent } from 'ng-mocks';
import { of } from 'rxjs';
import { ExplorerService } from '../../../../pages/explorer/explorer-service';
import { ExploreFilterLinkComponent } from '../../../components/explore-filter-link/explore-filter-link.component';
import { WaterfallWidgetRendererComponent } from './waterfall-widget-renderer.component';
import { WaterfallChartComponent } from './waterfall/waterfall-chart.component';

Expand All @@ -14,9 +17,13 @@ describe('Waterfall widget renderer component', () => {
const createComponent = createComponentFactory<WaterfallWidgetRendererComponent>({
component: WaterfallWidgetRendererComponent,
shallow: true,
imports: [LoadAsyncModule],
providers: [...mockDashboardWidgetProviders(mockModel), mockProvider(OverlayService)],
declarations: [MockComponent(WaterfallChartComponent)]
imports: [LoadAsyncModule, MemoizeModule],
providers: [
...mockDashboardWidgetProviders(mockModel),
mockProvider(OverlayService),
mockProvider(ExplorerService)
],
declarations: [MockComponent(WaterfallChartComponent), MockComponent(ExploreFilterLinkComponent)]
Copy link
Contributor

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)

});

test('renders the widget', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ import {
ViewChild
} from '@angular/core';
import { IconType } from '@hypertrace/assets-library';
import { ButtonStyle, OverlayService, SheetRef, SheetSize } from '@hypertrace/components';
import { NavigationParams } from '@hypertrace/common';
import { ButtonStyle, FilterOperator, OverlayService, SheetRef, SheetSize } from '@hypertrace/components';
import { WidgetRenderer } from '@hypertrace/dashboards';
import { Renderer } from '@hypertrace/hyperdash';
import { RendererApi, RENDERER_API } from '@hypertrace/hyperdash-angular';
import { isEmpty } from 'lodash-es';
import { Observable } from 'rxjs';
import { ExplorerService } from '../../../../pages/explorer/explorer-service';
import { ScopeQueryParam } from '../../../../pages/explorer/explorer.component';
import { SpanDetailLayoutStyle } from '../../../components/span-detail/span-detail-layout-style';
import { SpanDetailTab } from '../../../components/span-detail/span-detail-tab';
import { WaterfallWidgetModel } from './waterfall-widget.model';
Expand Down Expand Up @@ -67,12 +70,18 @@ import { MarkerSelection, WaterfallChartComponent } from './waterfall/waterfall-
[activeTabLabel]="this.activeTabLabel"
(closed)="this.closeSheet()"
>
<ht-summary-value
data-sensitive-pii
icon="${IconType.SpanId}"
label="Span ID"
[value]="this.selectedData!.id"
></ht-summary-value>
<ht-explore-filter-link
class="filter-link"
[paramsOrUrl]="getExploreNavigationParams | htMemoize: this.selectedData | async"
htTooltip="See traces in Explorer"
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@jyothishjose6190 Please update this.

>
<ht-summary-value
data-sensitive-pii
icon="${IconType.SpanId}"
label="Span ID"
[value]="this.selectedData!.id"
></ht-summary-value>
</ht-explore-filter-link>
</ht-span-detail>
</div>
</ng-template>
Expand All @@ -94,7 +103,8 @@ export class WaterfallWidgetRendererComponent
public constructor(
@Inject(RENDERER_API) api: RendererApi<WaterfallWidgetModel>,
changeDetector: ChangeDetectorRef,
private readonly overlayService: OverlayService
private readonly overlayService: OverlayService,
private readonly explorerService: ExplorerService
) {
super(api, changeDetector);
}
Expand Down Expand Up @@ -141,4 +151,9 @@ export class WaterfallWidgetRendererComponent
protected fetchData(): Observable<WaterfallData[]> {
return this.model.getData();
}

public getExploreNavigationParams = (selectedData: WaterfallData | undefined): Observable<NavigationParams> =>
this.explorerService.buildNavParamsWithFilters(ScopeQueryParam.Spans, [
{ field: 'id', operator: FilterOperator.Equals, value: selectedData!.id }
]);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MemoizeModule } from '@hypertrace/common';
import {
ButtonModule,
IconModule,
Expand All @@ -11,6 +12,7 @@ import {
TooltipModule
} from '@hypertrace/components';
import { DashboardCoreModule } from '@hypertrace/hyperdash-angular';
import { ExploreFilterLinkModule } from '../../../components/explore-filter-link/explore-filter-link.module';
import { SpanDetailModule } from '../../../components/span-detail/span-detail.module';
import { WaterfallWidgetRendererComponent } from './waterfall-widget-renderer.component';
import { WaterfallWidgetModel } from './waterfall-widget.model';
Expand All @@ -24,7 +26,9 @@ import { WaterfallChartModule } from './waterfall/waterfall-chart.module';
renderers: [WaterfallWidgetRendererComponent]
}),
CommonModule,
ExploreFilterLinkModule,
LabelModule,
MemoizeModule,
SpanDetailModule,
OverlayModule,
TooltipModule,
Expand Down