Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7cbd3aa
feat(supervisor): add ComputeWorkloadManager for compute gateway
nicktrn Feb 11, 2026
ccc8fe2
chore: merge main into feat/compute-workload-manager
nicktrn Feb 12, 2026
3175a10
fix(supervisor): strip image digest in ComputeWorkloadManager
nicktrn Feb 12, 2026
56ef39f
fix: add fetch timeout and wide event logging to ComputeWorkloadManager
nicktrn Feb 12, 2026
1bccd1e
feat: make gateway fetch timeout configurable
nicktrn Feb 12, 2026
74817d7
refactor(supervisor): improve ComputeWorkloadManager wide event logging
nicktrn Feb 12, 2026
a538735
feat(supervisor): send metadata in compute sandbox creation requests
nicktrn Feb 13, 2026
ac3dadf
feat(supervisor): send machine cpu/memory in compute sandbox requests
nicktrn Feb 13, 2026
5a7b8ce
feat(supervisor): add dequeue and warm start timing to wide event
nicktrn Feb 18, 2026
7e251d4
Merge branch 'main' into HEAD
nicktrn Feb 18, 2026
e4915c4
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Feb 18, 2026
4d603ad
feat(supervisor): add compute checkpoint/restore support
nicktrn Feb 20, 2026
9466a47
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Feb 20, 2026
c1511f9
fix(cli): fix --load flag on local/self-hosted builds
nicktrn Feb 20, 2026
0a6d6f1
feat(supervisor): pass name, metadata, and resources in compute resto…
nicktrn Feb 21, 2026
4332743
feat(supervisor): add flag to enable compute snapshots
nicktrn Feb 21, 2026
5089bba
feat(supervisor): require metadata URL when compute snapshots enabled
nicktrn Feb 23, 2026
7ed9221
fix(supervisor): require workload API domain when compute snapshots e…
nicktrn Feb 23, 2026
e9b5fd3
fix(supervisor): don't destroy compute instance after snapshot
nicktrn Mar 2, 2026
0531a23
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Mar 2, 2026
9572c7d
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Mar 3, 2026
5032b7f
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Mar 4, 2026
f3e0cb8
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Mar 5, 2026
0edc308
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Mar 6, 2026
63424fa
feat(supervisor): add snapshot delay for compute path via timer wheel
nicktrn Mar 10, 2026
80b62d4
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Mar 10, 2026
8b4c6bf
feat: emit compute OTel spans (provision, restore, snapshot) in run t…
nicktrn Mar 24, 2026
f70be68
refactor(supervisor): demote per-run logs to debug/verbose for quiete…
nicktrn Mar 24, 2026
bc05705
feat(supervisor): add COMPUTE_TRACE_OTLP_ENDPOINT override and demote…
nicktrn Mar 24, 2026
7349acb
Merge remote-tracking branch 'origin/main' into feat/compute-workload…
nicktrn Mar 24, 2026
7b37b0c
feat(database): add WorkloadType enum and column to WorkerInstanceGroup
nicktrn Mar 26, 2026
441334b
feat(core): add shared compute gateway client and template creation t…
nicktrn Mar 26, 2026
d0149e9
feat(webapp): add compute template creation service
nicktrn Mar 26, 2026
50cf672
feat(webapp): integrate template creation into deploy finalize flow
nicktrn Mar 26, 2026
899a7fb
fix: deduplicate shadow template creation and reuse service instance
nicktrn Mar 26, 2026
3cc7874
fix(webapp): add template creation to V1 finalize path (non-remote bu…
nicktrn Mar 26, 2026
8f08403
refactor: move compute gateway client from @trigger.dev/core to @inte…
nicktrn Mar 26, 2026
d0445ef
fix: simplify gateway client return type, remove unused json parsing
nicktrn Mar 26, 2026
1834da4
fix(supervisor): address review feedback on compute workload manager
nicktrn Mar 26, 2026
76e5715
refactor: convert span-timeline-events from always-loaded rule to on-…
nicktrn Mar 26, 2026
2397101
chore: merge main into feat/compute-workload-manager
nicktrn Mar 26, 2026
6e32bb7
feat(webapp): add hasComputeAccess feature flag for private beta org …
nicktrn Mar 26, 2026
64b08b9
fix: skip resolveMode early when compute gateway is not configured
nicktrn Mar 27, 2026
6809f07
fix: shadow mode uses fire-and-forget HTTP to avoid holding connections
nicktrn Mar 27, 2026
5d24dd1
feat(webapp): use background flag for shadow mode template creation
nicktrn Mar 27, 2026
4cbbadb
refactor: consolidate template creation logic into ComputeTemplateCre…
nicktrn Mar 27, 2026
eef782f
fix: use .then() instead of .catch() for shadow mode error logging
nicktrn Mar 27, 2026
2219d11
fix: update consumerPool test assertion for optional timing parameter
nicktrn Mar 27, 2026
b7fa420
refactor: consolidate compute gateway clients into shared @internal/c…
nicktrn Mar 27, 2026
d8e478a
fix: add type-safe post return, strip image digests consistently
nicktrn Mar 27, 2026
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
5 changes: 5 additions & 0 deletions .changeset/fix-local-build-load.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---

Fix `--load` flag being silently ignored on local/self-hosted builds.
78 changes: 78 additions & 0 deletions .claude/skills/span-timeline-events/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
name: span-timeline-events
description: Use when adding, modifying, or debugging OTel span timeline events in the trace view. Covers event structure, ClickHouse storage constraints, rendering in SpanTimeline component, admin visibility, and the step-by-step process for adding new events.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
---

# Span Timeline Events

The trace view's right panel shows a timeline of events for the selected span. These are OTel span events rendered by `app/utils/timelineSpanEvents.ts` and the `SpanTimeline` component.

## How They Work

1. **Span events** in OTel are attached to a parent span. In ClickHouse, they're stored as separate rows with `kind: "SPAN_EVENT"` sharing the parent span's `span_id`. The `#mergeRecordsIntoSpanDetail` method reassembles them into the span's `events` array at query time.
2. The timeline only renders events whose `name` starts with `trigger.dev/` - all others are silently filtered out.
3. The **display name** comes from `properties.event` (not the span event name), mapped through `getFriendlyNameForEvent()`.
4. Events are shown on the **span they belong to** - events on one span don't appear in another span's timeline.

## ClickHouse Storage Constraint

When events are written to ClickHouse, `spanEventsToTaskEventV1Input()` filters out events whose `start_time` is not greater than the parent span's `startTime`. Events at or before the span start are silently dropped. This means span events must have timestamps strictly after the span's own `startTimeUnixNano`.

## Timeline Rendering (SpanTimeline component)

The `SpanTimeline` component in `app/components/run/RunTimeline.tsx` renders:

1. **Events** (thin 1px line with hollow dots) - all events from `createTimelineSpanEventsFromSpanEvents()`
2. **"Started"** marker (thick cap) - at the span's `startTime`
3. **Duration bar** (thick 7px line) - from "Started" to "Finished"
4. **"Finished"** marker (thick cap) - at `startTime + duration`

The thin line before "Started" only appears when there are events with timestamps between the span start and the first child span. For the Attempt span this works well (Dequeued -> Pod scheduled -> Launched -> etc. all happen before execution starts). Events all get `lineVariant: "light"` (thin) while the execution bar gets `variant: "normal"` (thick).

## Trace View Sort Order

Sibling spans (same parent) are sorted by `start_time ASC` from the ClickHouse query. The `createTreeFromFlatItems` function preserves this order. Event timestamps don't affect sort order - only the span's own `start_time`.

## Event Structure

```typescript
// OTel span event format
{
name: "trigger.dev/run", // Must start with "trigger.dev/" to render
timeUnixNano: "1711200000000000000",
attributes: [
{ key: "event", value: { stringValue: "dequeue" } }, // The actual event type
{ key: "duration", value: { intValue: 150 } }, // Optional: duration in ms
]
}
```

## Admin-Only Events

`getAdminOnlyForEvent()` controls visibility. Events default to **admin-only** (`true`).

| Event | Admin-only | Friendly name |
|-------|-----------|---------------|
| `dequeue` | No | Dequeued |
| `fork` | No | Launched |
| `import` | No (if no fork event) | Importing task file |
| `create_attempt` | Yes | Attempt created |
| `lazy_payload` | Yes | Lazy attempt initialized |
| `pod_scheduled` | Yes | Pod scheduled |
| (default) | Yes | (raw event name) |

## Adding New Timeline Events

1. Add OTLP span event with `name: "trigger.dev/<scope>"` and `properties.event: "<type>"`
2. Event timestamp must be strictly after the parent span's `startTimeUnixNano` (ClickHouse drops earlier events)
3. Add friendly name in `getFriendlyNameForEvent()` in `app/utils/timelineSpanEvents.ts`
4. Set admin visibility in `getAdminOnlyForEvent()`
5. Optionally add help text in `getHelpTextForEvent()`

## Key Files

- `app/utils/timelineSpanEvents.ts` - filtering, naming, admin logic
- `app/components/run/RunTimeline.tsx` - `SpanTimeline` component (thin line + thick bar rendering)
- `app/presenters/v3/SpanPresenter.server.ts` - loads span data including events
- `app/v3/eventRepository/clickhouseEventRepository.server.ts` - `spanEventsToTaskEventV1Input()` (storage filter), `#mergeRecordsIntoSpanDetail` (reassembly)
1 change: 1 addition & 0 deletions apps/supervisor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"@aws-sdk/client-ecr": "^3.839.0",
"@kubernetes/client-node": "^1.0.0",
"@internal/compute": "workspace:*",
"@trigger.dev/core": "workspace:*",
"dockerode": "^4.0.6",
"prom-client": "^15.1.0",
Expand Down
Loading
Loading