Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
efcafdf
fix(webapp): filter dev environments by userId in OrganizationsPresen…
ericallam Mar 26, 2026
3855948
feat: replicate trigger_source, root_trigger_source, and is_warm_star…
myftija Mar 26, 2026
922a852
fix(Vercel): Initial deployment fix (#3263)
0ski Mar 26, 2026
cd7d759
fix(webapp): Only show bright title text on the right hand inspector …
samejr Mar 26, 2026
8244ac6
feat(Notifications): Platform notifications for CLI and Dashboard (#…
0ski Mar 26, 2026
21cf8f9
fix(webapp): disable resizable panel cookie saves to prevent large co…
ericallam Mar 27, 2026
efe24f9
feat(private-link): Add private links UI (#3264)
0ski Mar 27, 2026
2366b21
fix(private-links): Private Links plans adjustments (#3285)
0ski Mar 27, 2026
9cb3dcb
feat(supervisor): compute workload manager (#3114)
nicktrn Mar 29, 2026
66b7010
feat(webapp): Org level feature flags for Private Links (#3287)
0ski Mar 30, 2026
7210bde
feat(supervisor): custom tolerations for scheduled runs (#3297)
myftija Mar 30, 2026
5447cf4
feat(webapp): admin UI for feature flag overrides (#3291)
nicktrn Mar 30, 2026
b075678
fix(llm-catalog): refresh default model pricing on sync (#3281)
ericallam Mar 30, 2026
0e63f83
feat: add ttl support at task and config levels (#3196)
nicktrn Mar 30, 2026
a340728
feat(engine): enqueue fast path; skip the queue under certain conditi…
ericallam Mar 31, 2026
1307d97
fix(webapp): match environment when searching env variables (#3302)
myftija Mar 31, 2026
2ba77d8
fix: add build step to @internal/compute package (#3303)
nicktrn Mar 31, 2026
0977c56
Errors (versions) (#3187)
matt-aitken Mar 31, 2026
2637e47
docs: add migration guide from n8n to Trigger.dev (#3283)
isshaddad Mar 31, 2026
68e88d0
Object Storage seamless migration (#3275)
matt-aitken Apr 1, 2026
f75d4d6
docs: Remove old idempotencyKey warning (#3306)
D-K-P Apr 1, 2026
bf736a7
Feat(webapp): Models page UI improvements (#3308)
samejr Apr 1, 2026
0e14b6d
TaskRun optimizations: dropping FKs and some indexes (#3309)
matt-aitken Apr 1, 2026
ed64042
feat(private-links): Show assigned IPs for provisioned private links …
0ski Apr 2, 2026
f1f1d02
feat(dashboard): a few tweaks to the AI models page (#3315)
ericallam Apr 2, 2026
e31b03e
fix(webapp): Responsive improvements for the onboarding screens (#3318)
samejr Apr 2, 2026
cf0fdde
Feat(webapp): animated resizable panel (#3319)
samejr Apr 3, 2026
4f2ff3d
fix(wabapp): Fix for wrapping text on run inspector (#3328)
samejr Apr 4, 2026
def21b2
fix(batch): retry R2 upload on transient failure in BatchPayloadProce…
matt-aitken Apr 7, 2026
bd41bb2
feat(webapp): set application_name on prisma connections (#3348)
nicktrn Apr 8, 2026
e59614a
feat(webapp): gate microvm regions behind compute access feature flag…
nicktrn Apr 13, 2026
3c9647c
feat(webapp): Platform notifications admin imporovements (#3324)
0ski Apr 13, 2026
5ea36e0
chore: release v4.4.4 (#3228)
github-actions[bot] Apr 13, 2026
ac1b45a
feat(cli): add two-phase deploy (build-only + register-only)
amarbakir-govsignals Mar 26, 2026
1168dce
feat(webapp): add DEPLOY_IMAGE_OVERRIDE env var for custom image refe…
amarbakir-govsignals Mar 26, 2026
163de5b
chore: add govsignals CVE-remediation pnpm overrides
amarbakir-govsignals Mar 28, 2026
29462c6
fix(core): inline @trigger.dev/database types to fix pruned monorepo …
amarbakir-govsignals Mar 29, 2026
203c4e0
feat(supervisor): parameterize worker-pod annotations via KUBERNETES_…
Apr 29, 2026
be659ba
feat(helm): add supervisor.extraVolumes/extraVolumeMounts
Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .changeset/ai-prompt-management.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-dev-build-dir-leak.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-list-deploys-nullable.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/llm-metadata-run-tags.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/mcp-get-span-details.md

This file was deleted.

42 changes: 0 additions & 42 deletions .changeset/mcp-query-tools.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/tame-oranges-change.md

This file was deleted.

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)
25 changes: 22 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,28 @@ POSTHOG_PROJECT_KEY=
# DEPOT_TOKEN=<Depot org token>
# DEV_OTEL_EXPORTER_OTLP_ENDPOINT="http://0.0.0.0:4318"
# These are needed for the object store (for handling large payloads/outputs)
# OBJECT_STORE_BASE_URL="https://{bucket}.{accountId}.r2.cloudflarestorage.com"
# OBJECT_STORE_ACCESS_KEY_ID=
# OBJECT_STORE_SECRET_ACCESS_KEY=
#
# Default provider
# OBJECT_STORE_BASE_URL=http://localhost:9005
# OBJECT_STORE_BUCKET=packets
# OBJECT_STORE_ACCESS_KEY_ID=minioadmin
# OBJECT_STORE_SECRET_ACCESS_KEY=minioadmin
# OBJECT_STORE_REGION=us-east-1
# OBJECT_STORE_SERVICE=s3
#
# OBJECT_STORE_DEFAULT_PROTOCOL=s3 # Only specify this if you're going to migrate object storage and set protocol values below
# Named providers (protocol-prefixed data) - optional for multi-provider support
# OBJECT_STORE_S3_BASE_URL=https://s3.amazonaws.com
# OBJECT_STORE_S3_ACCESS_KEY_ID=
# OBJECT_STORE_S3_SECRET_ACCESS_KEY=
# OBJECT_STORE_S3_REGION=us-east-1
# OBJECT_STORE_S3_SERVICE=s3
#
# OBJECT_STORE_R2_BASE_URL=https://{bucket}.{accountId}.r2.cloudflarestorage.com
# OBJECT_STORE_R2_ACCESS_KEY_ID=
# OBJECT_STORE_R2_SECRET_ACCESS_KEY=
# OBJECT_STORE_R2_REGION=auto
# OBJECT_STORE_R2_SERVICE=s3
# CHECKPOINT_THRESHOLD_IN_MS=10000

# These control the server-side internal telemetry
Expand Down
30 changes: 0 additions & 30 deletions .server-changes/ai-prompt-management.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/allow-rollbacks-promote-api.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/ck-index-master-queue-dedup.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/fix-batch-waitpoint-lock-contention.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/fix-clickhouse-query-client-secure-param.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/llm-cost-tracking.md

This file was deleted.

6 changes: 0 additions & 6 deletions .server-changes/mcp-get-span-details.md

This file was deleted.

4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ pnpm run changeset:add

When modifying only server components (`apps/webapp/`, `apps/supervisor/`, etc.) with no package changes, add a `.server-changes/` file instead. See `.server-changes/README.md` for format and documentation.

## Dependency Pinning

Zod is pinned to a single version across the entire monorepo (currently `3.25.76`). When adding zod to a new or existing package, use the **exact same version** as the rest of the repo - never a different version or a range. Mismatched zod versions cause runtime type incompatibilities (e.g., schemas from one package can't be used as body validators in another).

## Architecture Overview

### Request Flow
Expand Down
3 changes: 2 additions & 1 deletion apps/supervisor/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm fetch -
FROM deps-fetcher AS dev-deps
ENV NODE_ENV development

RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile --offline --ignore-scripts
# TEMP --no-frozen-lockfile and remove --offline for overrides for CVEs
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --no-frozen-lockfile --ignore-scripts

FROM base AS builder

Expand Down
2 changes: 2 additions & 0 deletions apps/supervisor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
},
"dependencies": {
"@aws-sdk/client-ecr": "^3.839.0",
"@internal/compute": "workspace:*",
"@kubernetes/client-node": "^1.0.0",
"@trigger.dev/core": "workspace:*",
"dockerode": "^4.0.6",
"p-limit": "^6.2.0",
"prom-client": "^15.1.0",
"socket.io": "4.7.4",
"std-env": "^3.8.0",
Expand Down
Loading
Loading