Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -9,7 +9,7 @@ export class DisplayNumberPipe implements PipeTransform {
private static readonly FLOAT_FORMATTER: NumericFormatter = floatFormatter;

public transform(value: unknown, style: FormatterStyle = FormatterStyle.Auto): string {
if (value === null) {
if (value === null || value === undefined) {
return '-';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class MetricTableCellParser extends TableCellParserBase<number, CellValue
case 'number':
return cellData;
case 'object':
return cellData === null ? undefined : cellData.value;
return cellData?.value ?? undefined;
default:
return undefined;
}
Expand All @@ -36,12 +36,16 @@ export class MetricTableCellParser extends TableCellParserBase<number, CellValue
case 'number':
return undefined;
case 'object':
return cellData === null ? undefined : cellData.units;
return cellData?.units ?? undefined;
default:
return undefined;
}
}
}

type CellData = number | null | Partial<MetricAggregation>;
type CellData = number | null | Partial<NullableValueMetricAggregation>;
type CellValue = number | undefined;

interface NullableValueMetricAggregation extends Omit<MetricAggregation, 'value'> {
value: number | null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
TABLE_DATA_PARSER,
TABLE_ROW_DATA
} from '@hypertrace/components';
import { MetricAggregation } from '../../../../../shared/graphql/model/metrics/metric-aggregation';
import { MetricAggregation } from '../../../../graphql/model/metrics/metric-aggregation';
import { TracingTableCellType } from '../../tracing-table-cell-type';

@Component({
Expand All @@ -23,10 +23,10 @@ import { TracingTableCellType } from '../../tracing-table-cell-type';
template: `
<div class="metric-cell" [htTooltip]="this.tooltip">
<!-- This displays as "<value> <unit>", e.g. 120 ms -->
<span
>{{ this.value | htDisplayNumber: this.formatter }}
<span *ngIf="this.value !== undefined && this.units">{{ this.units }}</span></span
<span *ngIf="this.value !== undefined"
>{{ this.value | htDisplayNumber: this.formatter }} <span *ngIf="this.units">{{ this.units }}</span></span
>
<span *ngIf="this.value === undefined">-</span>
</div>
`
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { EntityNavigationService } from '../../services/navigation/entity/entity
class="ht-entity-renderer"
[ngClass]="{ navigable: this.navigable }"
[htTooltip]="this.name"
(click)="this.onClickNavigate()"
(click)="this.navigable && this.onClickNavigate()"
>
<ht-icon
[icon]="this.entityIconType"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TableCellParser, TableCellParserBase, TableRow } from '@hypertrace/components';
import { Entity, entityIdKey } from '../../../../graphql/model/schema/entity';
import { ObservabilityTableCellType } from '../../observability-table-cell-type';
import { parseEntityFromTableRow } from '../entity/entity-table-cell-renderer-util';
import { parseEntityFromTableRow } from './entity-table-cell-renderer-util';

@TableCellParser({
type: ObservabilityTableCellType.Entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@hypertrace/graphql-client';
import { Observable } from 'rxjs';
import { map, throwIfEmpty } from 'rxjs/operators';
import { Entity, EntityType } from '../../../../../model/schema/entity';
import { Entity, EntityType, ObservabilityEntityType } from '../../../../../model/schema/entity';
import { GraphQlEntityFilter } from '../../../../../model/schema/filter/entity/graphql-entity-filter';
import { EntitiesGraphqlQueryBuilderService } from '../entities-graphql-query-builder.service';
import {
Expand Down Expand Up @@ -56,7 +56,9 @@ export class EntityGraphQlQueryHandlerService implements GraphQlQueryHandler<Gra
limit: 1,
timeRange: request.timeRange,
properties: request.properties,
filters: [new GraphQlEntityFilter(request.id, request.entityType)]
filters: [new GraphQlEntityFilter(request.id, request.entityType)],
// If querying for a single API, then always want to includeInactive
includeInactive: request.entityType === ObservabilityEntityType.Api
Copy link
Contributor

Choose a reason for hiding this comment

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

This would apply always right? Even if we disabled this functionality elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. Good point. It would. Not sure how to feature flag this cleanly. Open to suggestions.

};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ describe('Interactions graphql query handler', () => {
idType: new GraphQlEnumArgument(ObservabilityEntityType.Backend)
}
]
},
{
name: 'includeInactive',
value: false
}
],
children: [
Expand Down