Skip to content

Commit 7768bb0

Browse files
authored
Fix: Trace view improvements (#3702)
* fix: migration first pass * fix: move migration * chore: rm old idx from schema * feat: remove status partitioning function + update call sites * fix: add analyze * fix: oops don't actually need analyze * fix: timestamps, add link to note * feat: start reworking migration * fix: don't need to recreate or drop indexes in down migration * fix: rm second migration for now * feat: re add second migration for cutover * refactor: improve naming and stuff * fix: make sure we add indexes properly, migration cleanup * feat: add back triggers post-cutover * fix: use create or replace trigger instead * fix: update insert functions to have correct on conflict spec * fix: copy paste * fix: rm separate statements * fix: rm unused func * fix: add case when logic to backfill * feat: run backfills concurrently * fix: copy paste issues * fix: add if not exists to index create * fix: create or replace trigger * fix: update handling * fix: rename migrations * fix: func naming * fix: remove a bunch of custom span naming to be more consistent with other otel tools * fix: remove custom span name mapping in favor of just showing the plain span names * fix: remove trace minimap view / filter since it doesn't work * fix: show more spans by default * fix: expand / collapse button * feat: use the side panel for the expanded span view thingy * fix: improve ux of side panel * fix: date formatting * fix: decimal precision * fix: spacing * chore: lint * fix: overflow state * fix: side panel overflow * fix: copilot comments * fix: add back minimap * refactor: try to minimize diff * fix: un-revert button changes
1 parent d89ce82 commit 7768bb0

14 files changed

Lines changed: 711 additions & 727 deletions

File tree

api-contracts/openapi/components/schemas/v1/feature_flags.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ FeatureFlagId:
1313
type: string
1414
enum:
1515
- "tenant-log-workflow-filter-enabled"
16+
- "trace-minimap-enabled"

api/v1/server/oas/gen/openapi.gen.go

Lines changed: 313 additions & 312 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/app/src/hooks/use-side-panel.tsx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
import { useTheme } from '@/components/hooks/use-theme';
2+
import type { OtelSpanTree } from '@/components/v1/agent-prism/span-tree-type';
3+
import type { ParsedTraceQuery } from '@/components/v1/cloud/observability/trace-search';
24
import { DocPage } from '@/components/v1/docs/docs-button';
35
import { V1Event, V1Filter, ScheduledWorkflows } from '@/lib/api';
46
import { ExpandedEventContent } from '@/pages/main/v1/events';
57
import { FilterDetailView } from '@/pages/main/v1/filters/components/filter-detail-view';
68
import { ExpandedScheduledRunContent } from '@/pages/main/v1/scheduled-runs/components/expanded-scheduled-run-content';
9+
import {
10+
SpanDetail,
11+
GroupDetail,
12+
} from '@/pages/main/v1/workflow-runs-v1/$run/v2components/step-run-detail/observability/span-detail';
13+
import type { SpanGroupInfo } from '@/pages/main/v1/workflow-runs-v1/$run/v2components/step-run-detail/observability/timeline/trace-timeline-utils';
714
import {
815
TaskRunDetail,
916
TabOption,
@@ -74,6 +81,24 @@ type UseSidePanelProps =
7481
content: {
7582
scheduledRun: ScheduledWorkflows;
7683
};
84+
}
85+
| {
86+
type: 'span-details';
87+
content: {
88+
span: OtelSpanTree;
89+
activeFilters?: ParsedTraceQuery;
90+
onAddFilter?: (key: string, value: string) => void;
91+
onRemoveFilter?: (key: string, value: string) => void;
92+
onSpanSelect?: (span: OtelSpanTree) => void;
93+
onClose?: () => void;
94+
};
95+
}
96+
| {
97+
type: 'group-details';
98+
content: {
99+
group: SpanGroupInfo;
100+
onClose?: () => void;
101+
};
77102
};
78103

79104
function SidePanelTaskRunDetail(props: {
@@ -88,6 +113,23 @@ function SidePanelTaskRunDetail(props: {
88113
);
89114
}
90115

116+
function SidePanelSpanDetail(
117+
props: Omit<React.ComponentProps<typeof SpanDetail>, 'onOpenTaskRun'>,
118+
) {
119+
const { open } = useSidePanel();
120+
return (
121+
<SpanDetail
122+
{...props}
123+
onOpenTaskRun={(taskRunId) =>
124+
open({
125+
type: 'task-run-details',
126+
content: { taskRunId, showViewTaskRunButton: true },
127+
})
128+
}
129+
/>
130+
);
131+
}
132+
91133
function useSidePanelData(): SidePanelData {
92134
const [isOpen, setIsOpen] = useState(false);
93135
const [history, setHistory] = useState<UseSidePanelProps[]>([]);
@@ -141,6 +183,16 @@ function useSidePanelData(): SidePanelData {
141183
/>
142184
),
143185
};
186+
case 'span-details':
187+
return {
188+
isDocs: false,
189+
component: <SidePanelSpanDetail {...props.content} />,
190+
};
191+
case 'group-details':
192+
return {
193+
isDocs: false,
194+
component: <GroupDetail {...props.content} />,
195+
};
144196
case 'docs':
145197
const query = props.queryParams ?? {};
146198
query.theme = theme;

frontend/app/src/lib/api/generated/data-contracts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export enum PullRequestState {
4141

4242
export enum FeatureFlagId {
4343
TenantLogWorkflowFilterEnabled = "tenant-log-workflow-filter-enabled",
44+
TraceMinimapEnabled = "trace-minimap-enabled",
4445
}
4546

4647
export enum WebhookWorkerRequestMethod {

frontend/app/src/pages/main/v1/workflow-runs-v1/$run/v2components/step-run-detail/observability/minimap/minimap-utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
getDisplayName,
32
hasErrorInTree,
43
isQueuedOnly,
54
isQueuedOnlyRoot,
@@ -30,7 +29,7 @@ export function collectSpanMarkers(
3029
statusCode: node.statusCode,
3130
hasErrorInTree: hasErrorInTree(node),
3231
inProgress: !!node.inProgress,
33-
spanName: getDisplayName(node),
32+
spanName: node.spanName,
3433
durationMs: node.durationNs / 1_000_000,
3534
visible: parentVisible,
3635
span: node,

0 commit comments

Comments
 (0)