Skip to content

Commit eac9f7a

Browse files
authored
ref(agents-insights): update trace colors (#94155)
1 parent c8bb5d7 commit eac9f7a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

static/app/views/insights/agentMonitoring/components/aiSpanList.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {useTheme} from '@emotion/react';
33
import styled from '@emotion/styled';
44

55
import Placeholder from 'sentry/components/placeholder';
6-
import {IconCode, IconSort} from 'sentry/icons';
6+
import {IconChevron, IconCode} from 'sentry/icons';
77
import {IconBot} from 'sentry/icons/iconBot';
88
import {IconSpeechBubble} from 'sentry/icons/iconSpeechBubble';
99
import {IconTool} from 'sentry/icons/iconTool';
@@ -14,6 +14,7 @@ import {
1414
AI_AGENT_NAME_ATTRIBUTE,
1515
AI_GENERATION_DESCRIPTIONS,
1616
AI_GENERATION_OPS,
17+
AI_HANDOFF_OPS,
1718
AI_MODEL_ID_ATTRIBUTE,
1819
AI_RUN_DESCRIPTIONS,
1920
AI_RUN_OPS,
@@ -253,7 +254,7 @@ function getNodeInfo(
253254
icon: <IconCode size="md" />,
254255
title: 'Unknown',
255256
subtitle: '',
256-
color: colors[0],
257+
color: colors[1],
257258
};
258259

259260
if (isTransactionNode(node)) {
@@ -288,7 +289,7 @@ function getNodeInfo(
288289
nodeInfo.icon = <IconBot size="md" />;
289290
nodeInfo.title = op;
290291
nodeInfo.subtitle = `${agentName}${model ? ` (${model})` : ''}`;
291-
nodeInfo.color = colors[1];
292+
nodeInfo.color = colors[0];
292293
} else if (
293294
AI_GENERATION_OPS.includes(op) ||
294295
AI_GENERATION_DESCRIPTIONS.includes(node.value.description ?? '')
@@ -305,10 +306,11 @@ function getNodeInfo(
305306
nodeInfo.icon = <IconTool size="md" />;
306307
nodeInfo.title = op || 'gen_ai.toolCall';
307308
nodeInfo.subtitle = getNodeAttribute(AI_TOOL_NAME_ATTRIBUTE) || '';
308-
nodeInfo.color = colors[3];
309-
} else if (op === 'http.client') {
310-
nodeInfo.icon = <IconSort size="md" />;
311-
nodeInfo.title = node.value.description || 'HTTP';
309+
nodeInfo.color = colors[5];
310+
} else if (AI_HANDOFF_OPS.includes(op)) {
311+
nodeInfo.icon = <IconChevron size="md" isDouble direction="right" />;
312+
nodeInfo.title = op;
313+
nodeInfo.subtitle = node.value.description || '';
312314
nodeInfo.color = colors[4];
313315
} else {
314316
nodeInfo.title = op || 'Span';

static/app/views/insights/agentMonitoring/utils/query.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export const AI_TOOL_NAME_ATTRIBUTE = 'gen_ai.tool.name' as EAPSpanProperty;
4949
export const AI_AGENT_NAME_ATTRIBUTE = 'gen_ai.agent.name' as EAPSpanProperty;
5050
export const AI_TOTAL_TOKENS_ATTRIBUTE = 'gen_ai.usage.total_tokens' as EAPSpanProperty;
5151

52+
export const AI_HANDOFF_OPS = ['gen_ai.handoff'];
53+
5254
export const AI_TOKEN_USAGE_ATTRIBUTE_SUM =
5355
`sum(tags[gen_ai.usage.total_tokens,number])` as EAPSpanProperty;
5456
export const AI_INPUT_TOKENS_ATTRIBUTE_SUM =

0 commit comments

Comments
 (0)