diff --git a/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.component.scss b/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.component.scss index 5966b6e89..0e7b95ee3 100644 --- a/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.component.scss +++ b/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.component.scss @@ -12,5 +12,20 @@ .container { overflow: auto; flex: 1; + + .record-value { + width: 100%; + display: grid; + grid-template-columns: auto min-content; + + .filter-link { + visibility: hidden; + margin-left: 12px; + } + + &:hover .filter-link { + visibility: visible; + } + } } } diff --git a/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.component.ts b/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.component.ts index f9fe17967..64fe4d526 100644 --- a/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.component.ts +++ b/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.component.ts @@ -1,6 +1,7 @@ import { ChangeDetectionStrategy, Component, Input, OnChanges } from '@angular/core'; -import { Dictionary } from '@hypertrace/common'; -import { ListViewDisplay, ListViewRecord } from '@hypertrace/components'; +import { Dictionary, NavigationParams } from '@hypertrace/common'; +import { FilterOperator, ListViewDisplay, ListViewRecord } from '@hypertrace/components'; +import { ExplorerService, ScopeQueryParam } from '@hypertrace/observability'; import { isNil } from 'lodash-es'; import { EMPTY, Observable, of } from 'rxjs'; @@ -11,13 +12,21 @@ import { EMPTY, Observable, of } from 'rxjs'; template: `
-
+
- + +
+
+
{{ record.value }}
+ + +
+
+
@@ -33,14 +42,24 @@ export class SpanDetailCallHeadersComponent implements OnChanges { @Input() public title?: string; + @Input() + public filterName?: string; + public records$?: Observable; public label?: string; + public constructor(private readonly explorerService: ExplorerService) {} + public ngOnChanges(): void { this.buildRecords(); } + public getExploreNavigationParams = (record: ListViewRecord): Observable => + this.explorerService.buildNavParamsWithFilters(ScopeQueryParam.EndpointTraces, [ + { field: this.filterName ?? '', subpath: record.key, operator: FilterOperator.Equals, value: record.value } + ]); + private buildRecords(): void { if (isNil(this.data)) { this.records$ = EMPTY; diff --git a/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.module.ts b/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.module.ts index 5a97ca1c3..4383fce5f 100644 --- a/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.module.ts +++ b/projects/observability/src/shared/components/span-detail/call/headers/span-detail-call-headers.module.ts @@ -1,10 +1,20 @@ +import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; - -import { LabelModule, ListViewModule, LoadAsyncModule } from '@hypertrace/components'; +import { MemoizeModule } from '@hypertrace/common'; +import { LabelModule, ListViewModule, LoadAsyncModule, TooltipModule } from '@hypertrace/components'; import { SpanDetailCallHeadersComponent } from './span-detail-call-headers.component'; +import { ExploreFilterLinkModule } from '../../../explore-filter-link/explore-filter-link.module'; @NgModule({ - imports: [LabelModule, ListViewModule, LoadAsyncModule], + imports: [ + CommonModule, + LabelModule, + ListViewModule, + LoadAsyncModule, + ExploreFilterLinkModule, + MemoizeModule, + TooltipModule + ], declarations: [SpanDetailCallHeadersComponent], exports: [SpanDetailCallHeadersComponent] }) diff --git a/projects/observability/src/shared/components/span-detail/request/span-request-detail.component.ts b/projects/observability/src/shared/components/span-detail/request/span-request-detail.component.ts index 74f8ce575..e02b272d0 100644 --- a/projects/observability/src/shared/components/span-detail/request/span-request-detail.component.ts +++ b/projects/observability/src/shared/components/span-detail/request/span-request-detail.component.ts @@ -10,10 +10,18 @@ import { SpanDetailLayoutStyle } from '../span-detail-layout-style';
- +
- +
@@ -35,3 +43,8 @@ export class SpanRequestDetailComponent { @Input() public layout: SpanDetailLayoutStyle = SpanDetailLayoutStyle.Horizontal; } + +const enum RequestFilterName { + Headers = 'requestHeaders', + Cookies = 'requestCookies' +} diff --git a/projects/observability/src/shared/components/span-detail/response/span-response-detail.component.ts b/projects/observability/src/shared/components/span-detail/response/span-response-detail.component.ts index 33979a590..ca019c67b 100644 --- a/projects/observability/src/shared/components/span-detail/response/span-response-detail.component.ts +++ b/projects/observability/src/shared/components/span-detail/response/span-response-detail.component.ts @@ -10,13 +10,18 @@ import { SpanDetailLayoutStyle } from '../span-detail-layout-style';
- +
@@ -43,3 +48,8 @@ export class SpanResponseDetailComponent { @Input() public layout: SpanDetailLayoutStyle = SpanDetailLayoutStyle.Horizontal; } + +const enum ResponseFilterName { + Headers = 'responseHeaders', + Cookies = 'responseCookies' +}