Skip to content

Commit a9f10c5

Browse files
authored
feat: Add highlighted attributes to overview panel (#1395)
Closes HDX-2881 # Summary This PR adds the row-level highlighted attributes to the row overview panel, so that they appear for the span that is selected in the trace waterfall and in an expanded table row: <img width="1071" height="966" alt="Screenshot 2025-11-20 at 2 32 09 PM" src="https://github.com/user-attachments/assets/febb6c12-4c58-4eac-b085-cbad3601b2fe" /> <img width="814" height="275" alt="Screenshot 2025-11-20 at 2 32 16 PM" src="https://github.com/user-attachments/assets/b3c6fbeb-205e-4b6a-9dfd-5ed9457a57df" /> This PR also makes some small updates to the descriptions of the highlighted attributes in the source configuration form.
1 parent 70fe682 commit a9f10c5

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

.changeset/wicked-baboons-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
feat: Add highlighted attributes to overview panel

packages/app/src/components/DBRowOverviewPanel.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ import { useCallback, useContext, useMemo } from 'react';
22
import isString from 'lodash/isString';
33
import pickBy from 'lodash/pickBy';
44
import { SourceKind, TSource } from '@hyperdx/common-utils/dist/types';
5-
import { Accordion, Box, Divider, Flex, Text } from '@mantine/core';
5+
import { Accordion, Box, Flex, Text } from '@mantine/core';
66

77
import { getEventBody } from '@/source';
8+
import { getHighlightedAttributesFromData } from '@/utils/highlightedAttributes';
89

910
import { getJSONColumnNames, useRowData } from './DBRowDataPanel';
1011
import { DBRowJsonViewer } from './DBRowJsonViewer';
1112
import { RowSidePanelContext } from './DBRowSidePanel';
1213
import DBRowSidePanelHeader from './DBRowSidePanelHeader';
1314
import EventTag from './EventTag';
14-
import { ExceptionSubpanel, parseEvents } from './ExceptionSubpanel';
15+
import { ExceptionSubpanel } from './ExceptionSubpanel';
1516
import { NetworkPropertySubpanel } from './NetworkPropertyPanel';
1617
import { SpanEventsSubpanel } from './SpanEventsSubpanel';
1718

@@ -27,10 +28,26 @@ export function RowOverviewPanel({
2728
hideHeader?: boolean;
2829
'data-testid'?: string;
2930
}) {
30-
const { data, isLoading, isError } = useRowData({ source, rowId });
31+
const { data } = useRowData({ source, rowId });
3132
const { onPropertyAddClick, generateSearchUrl } =
3233
useContext(RowSidePanelContext);
3334

35+
const highlightedAttributeValues = useMemo(() => {
36+
const attributeExpressions =
37+
source.kind === SourceKind.Trace || source.kind === SourceKind.Log
38+
? (source.highlightedRowAttributeExpressions ?? [])
39+
: [];
40+
41+
return data
42+
? getHighlightedAttributesFromData(
43+
source,
44+
attributeExpressions,
45+
data.data || [],
46+
data.meta || [],
47+
)
48+
: [];
49+
}, [source, data]);
50+
3451
const jsonColumns = getJSONColumnNames(data?.meta);
3552

3653
const eventAttributesExpr = source.eventAttributesExpression;
@@ -164,6 +181,7 @@ export function RowOverviewPanel({
164181
{!hideHeader && (
165182
<Box px="sm" pt="md">
166183
<DBRowSidePanelHeader
184+
attributes={highlightedAttributeValues}
167185
date={new Date(firstRow?.__hdx_timestamp ?? 0)}
168186
mainContent={mainContent}
169187
mainContentHeader={mainContentColumn}

packages/app/src/components/EventTag.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export default function EventTag({
3737
}
3838
)) {
3939
const [opened, setOpened] = useState(false);
40-
const hasActions = !!onPropertyAddClick || !!generateSearchUrl;
40+
const isLink = isLinkableUrl(value);
41+
const hasActions = !!onPropertyAddClick || !!generateSearchUrl || isLink;
4142

4243
if (!hasActions) {
4344
return (
@@ -47,8 +48,6 @@ export default function EventTag({
4748
);
4849
}
4950

50-
const isLink = isLinkableUrl(value);
51-
5251
const searchCondition =
5352
nameLanguage === 'sql'
5453
? SqlString.format('? = ?', [SqlString.raw(name), value])

packages/app/src/components/SourceForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,13 @@ export function LogTableModelForm(props: TableModelProps) {
499499
{...props}
500500
name="highlightedRowAttributeExpressions"
501501
label="Highlighted Attributes"
502-
helpText="Expressions defining row-level attributes which are displayed in the search side panel."
502+
helpText="Expressions defining row-level attributes which are displayed in the row side panel for the selected row."
503503
/>
504504
<HighlightedAttributeExpressionsFormRow
505505
{...props}
506506
name="highlightedTraceAttributeExpressions"
507507
label="Highlighted Trace Attributes"
508-
helpText="Expressions defining trace-level attributes which are displayed in the search side panel."
508+
helpText="Expressions defining trace-level attributes which are displayed in the trace view for the selected trace."
509509
/>
510510
</Stack>
511511
</>
@@ -779,13 +779,13 @@ export function TraceTableModelForm(props: TableModelProps) {
779779
{...props}
780780
name="highlightedRowAttributeExpressions"
781781
label="Highlighted Attributes"
782-
helpText="Expressions defining row-level attributes which are displayed in the search side panel."
782+
helpText="Expressions defining row-level attributes which are displayed in the row side panel for the selected row"
783783
/>
784784
<HighlightedAttributeExpressionsFormRow
785785
{...props}
786786
name="highlightedTraceAttributeExpressions"
787787
label="Highlighted Trace Attributes"
788-
helpText="Expressions defining trace-level attributes which are displayed in the search side panel."
788+
helpText="Expressions defining trace-level attributes which are displayed in the trace view for the selected trace."
789789
/>
790790
</Stack>
791791
);

0 commit comments

Comments
 (0)