Skip to content

Commit 76e97c2

Browse files
committed
Record drilldown metadata in breakout drafts
1 parent 14687f8 commit 76e97c2

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

web-next/lib/signal-dashboards.test.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,8 @@ describe('signal dashboards API client', () => {
24832483
source: 'metrics-point',
24842484
label: 'signoz_db_latency_count',
24852485
value: '7',
2486-
meta: '2000'
2486+
meta: '2000',
2487+
resourceFilter: 'db.system=postgresql'
24872488
},
24882489
route: '/ingestion/otlp/metrics?query=signoz_db_latency_count&serviceName=checkout&series=postgresql&inspector=graph&start=1000&end=3000',
24892490
attribute: {
@@ -2509,6 +2510,7 @@ describe('signal dashboards API client', () => {
25092510
evidenceSource: 'metrics-point',
25102511
evidenceLabel: 'signoz_db_latency_count',
25112512
evidenceValue: '7',
2513+
resourceFilter: 'db.system=postgresql',
25122514
breakoutAttribute: 'db.system',
25132515
breakoutAttributeValue: 'postgresql'
25142516
}));
@@ -2521,7 +2523,8 @@ describe('signal dashboards API client', () => {
25212523
label: 'checkout',
25222524
value: 'timeout',
25232525
traceId: 'trace-1',
2524-
spanId: 'span-1'
2526+
spanId: 'span-1',
2527+
attributeFilter: 'region:us'
25252528
},
25262529
route: '/log/manage?view=table&traceId=trace-1&spanId=span-1&serviceName=checkout&serviceNamespace=payments&start=1000&end=3000',
25272530
attribute: {
@@ -2540,6 +2543,9 @@ describe('signal dashboards API client', () => {
25402543
expect(JSON.parse(String(logDraft?.payload))).toEqual(expect.objectContaining({
25412544
source: 'signal-dashboard-runtime-breakout',
25422545
sourcePanelId: 'logs-panel',
2546+
traceId: 'trace-1',
2547+
spanId: 'span-1',
2548+
attributeFilter: 'region:us',
25432549
breakoutAttribute: 'resource:service.name',
25442550
breakoutAttributeValue: 'checkout'
25452551
}));
@@ -2552,7 +2558,8 @@ describe('signal dashboards API client', () => {
25522558
label: 'checkout',
25532559
value: 'POST /checkout',
25542560
traceId: 'trace-1',
2555-
spanId: 'span-root'
2561+
spanId: 'span-root',
2562+
operationName: 'POST /checkout'
25562563
},
25572564
route: '/trace/manage?view=trace&traceId=trace-1&spanId=span-root&serviceName=checkout&serviceNamespace=payments&spanScope=all&start=1000&end=3000',
25582565
attribute: {
@@ -2571,6 +2578,9 @@ describe('signal dashboards API client', () => {
25712578
expect(JSON.parse(String(traceDraft?.payload))).toEqual(expect.objectContaining({
25722579
source: 'signal-dashboard-runtime-breakout',
25732580
sourcePanelId: 'trace-panel',
2581+
traceId: 'trace-1',
2582+
spanId: 'span-root',
2583+
operationName: 'POST /checkout',
25742584
breakoutAttribute: 'resource:service.version',
25752585
breakoutAttributeValue: '1.2.3'
25762586
}));

web-next/lib/signal-dashboards.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,11 @@ export function createSignalDashboardPanelDraftFromRuntimeBreakout(input: {
13141314
evidenceSource: input.row.source,
13151315
evidenceLabel,
13161316
evidenceValue: input.row.value,
1317+
...(input.row.traceId ? { traceId: input.row.traceId } : {}),
1318+
...(input.row.spanId ? { spanId: input.row.spanId } : {}),
1319+
...(input.row.operationName ? { operationName: input.row.operationName } : {}),
1320+
...(input.row.resourceFilter ? { resourceFilter: input.row.resourceFilter } : {}),
1321+
...(input.row.attributeFilter ? { attributeFilter: input.row.attributeFilter } : {}),
13171322
breakoutAttribute: attributeName,
13181323
...(attributeValue ? { breakoutAttributeValue: attributeValue } : {})
13191324
}

0 commit comments

Comments
 (0)