@trigger.dev/sdk 4.5.0-rc.6 → 4.5.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/v3/ai.d.ts +171 -5
- package/dist/commonjs/v3/ai.js +309 -22
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/chat-server.d.ts +8 -0
- package/dist/commonjs/v3/chat-server.js +32 -10
- package/dist/commonjs/v3/chat-server.js.map +1 -1
- package/dist/commonjs/v3/chat-server.test.js +51 -0
- package/dist/commonjs/v3/chat-server.test.js.map +1 -1
- package/dist/commonjs/v3/createStartSessionAction.test.js +30 -0
- package/dist/commonjs/v3/createStartSessionAction.test.js.map +1 -1
- package/dist/commonjs/v3/sessions.d.ts +3 -2
- package/dist/commonjs/v3/sessions.js +3 -2
- package/dist/commonjs/v3/sessions.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai.d.ts +171 -5
- package/dist/esm/v3/ai.js +309 -22
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/chat-server.d.ts +8 -0
- package/dist/esm/v3/chat-server.js +32 -10
- package/dist/esm/v3/chat-server.js.map +1 -1
- package/dist/esm/v3/chat-server.test.js +51 -0
- package/dist/esm/v3/chat-server.test.js.map +1 -1
- package/dist/esm/v3/createStartSessionAction.test.js +30 -0
- package/dist/esm/v3/createStartSessionAction.test.js.map +1 -1
- package/dist/esm/v3/sessions.d.ts +3 -2
- package/dist/esm/v3/sessions.js +3 -2
- package/dist/esm/v3/sessions.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai/prompts.mdx +430 -0
- package/docs/ai-chat/actions.mdx +115 -0
- package/docs/ai-chat/anatomy.mdx +71 -0
- package/docs/ai-chat/backend.mdx +817 -0
- package/docs/ai-chat/background-injection.mdx +221 -0
- package/docs/ai-chat/changelog.mdx +850 -0
- package/docs/ai-chat/chat-local.mdx +174 -0
- package/docs/ai-chat/client-protocol.mdx +1081 -0
- package/docs/ai-chat/compaction.mdx +411 -0
- package/docs/ai-chat/custom-agents.mdx +364 -0
- package/docs/ai-chat/error-handling.mdx +415 -0
- package/docs/ai-chat/fast-starts.mdx +672 -0
- package/docs/ai-chat/frontend.mdx +580 -0
- package/docs/ai-chat/how-it-works.mdx +230 -0
- package/docs/ai-chat/lifecycle-hooks.mdx +530 -0
- package/docs/ai-chat/mcp.mdx +101 -0
- package/docs/ai-chat/overview.mdx +90 -0
- package/docs/ai-chat/patterns/branching-conversations.mdx +284 -0
- package/docs/ai-chat/patterns/code-sandbox.mdx +126 -0
- package/docs/ai-chat/patterns/database-persistence.mdx +414 -0
- package/docs/ai-chat/patterns/human-in-the-loop.mdx +275 -0
- package/docs/ai-chat/patterns/large-payloads.mdx +169 -0
- package/docs/ai-chat/patterns/oom-resilience.mdx +120 -0
- package/docs/ai-chat/patterns/persistence-and-replay.mdx +211 -0
- package/docs/ai-chat/patterns/recovery-boot.mdx +230 -0
- package/docs/ai-chat/patterns/skills.mdx +221 -0
- package/docs/ai-chat/patterns/sub-agents.mdx +383 -0
- package/docs/ai-chat/patterns/tool-result-auditing.mdx +148 -0
- package/docs/ai-chat/patterns/trusted-edge-signals.mdx +337 -0
- package/docs/ai-chat/patterns/version-upgrades.mdx +172 -0
- package/docs/ai-chat/pending-messages.mdx +343 -0
- package/docs/ai-chat/prompt-caching.mdx +206 -0
- package/docs/ai-chat/quick-start.mdx +161 -0
- package/docs/ai-chat/reference.mdx +909 -0
- package/docs/ai-chat/server-chat.mdx +263 -0
- package/docs/ai-chat/sessions.mdx +333 -0
- package/docs/ai-chat/testing.mdx +682 -0
- package/docs/ai-chat/tools.mdx +191 -0
- package/docs/ai-chat/types.mdx +242 -0
- package/docs/ai-chat/upgrade-guide.mdx +515 -0
- package/docs/apikeys.mdx +54 -0
- package/docs/building-with-ai.mdx +261 -0
- package/docs/bulk-actions.mdx +49 -0
- package/docs/changelog.mdx +6 -0
- package/docs/cli-deploy-commands.mdx +9 -0
- package/docs/cli-dev-commands.mdx +9 -0
- package/docs/cli-dev.mdx +8 -0
- package/docs/cli-init-commands.mdx +58 -0
- package/docs/cli-introduction.mdx +25 -0
- package/docs/cli-list-profiles-commands.mdx +42 -0
- package/docs/cli-login-commands.mdx +33 -0
- package/docs/cli-logout-commands.mdx +33 -0
- package/docs/cli-preview-archive.mdx +59 -0
- package/docs/cli-promote-commands.mdx +9 -0
- package/docs/cli-switch.mdx +43 -0
- package/docs/cli-update-commands.mdx +42 -0
- package/docs/cli-whoami-commands.mdx +33 -0
- package/docs/community.mdx +6 -0
- package/docs/config/config-file.mdx +602 -0
- package/docs/config/extensions/additionalFiles.mdx +38 -0
- package/docs/config/extensions/additionalPackages.mdx +40 -0
- package/docs/config/extensions/aptGet.mdx +34 -0
- package/docs/config/extensions/audioWaveform.mdx +20 -0
- package/docs/config/extensions/custom.mdx +380 -0
- package/docs/config/extensions/emitDecoratorMetadata.mdx +29 -0
- package/docs/config/extensions/esbuildPlugin.mdx +31 -0
- package/docs/config/extensions/ffmpeg.mdx +45 -0
- package/docs/config/extensions/lightpanda.mdx +56 -0
- package/docs/config/extensions/overview.mdx +67 -0
- package/docs/config/extensions/playwright.mdx +195 -0
- package/docs/config/extensions/prismaExtension.mdx +1014 -0
- package/docs/config/extensions/puppeteer.mdx +30 -0
- package/docs/config/extensions/pythonExtension.mdx +182 -0
- package/docs/config/extensions/syncEnvVars.mdx +291 -0
- package/docs/context.mdx +235 -0
- package/docs/database-connections.mdx +213 -0
- package/docs/deploy-environment-variables.mdx +435 -0
- package/docs/deployment/atomic-deployment.mdx +172 -0
- package/docs/deployment/overview.mdx +257 -0
- package/docs/deployment/preview-branches.mdx +224 -0
- package/docs/errors-retrying.mdx +379 -0
- package/docs/github-actions.mdx +222 -0
- package/docs/github-integration.mdx +136 -0
- package/docs/github-repo.mdx +8 -0
- package/docs/help-email.mdx +6 -0
- package/docs/help-slack.mdx +11 -0
- package/docs/hidden-tasks.mdx +56 -0
- package/docs/how-it-works.mdx +454 -0
- package/docs/how-to-reduce-your-spend.mdx +217 -0
- package/docs/idempotency.mdx +504 -0
- package/docs/introduction.mdx +223 -0
- package/docs/limits.mdx +241 -0
- package/docs/logging.mdx +195 -0
- package/docs/machines.mdx +952 -0
- package/docs/manual-setup.mdx +632 -0
- package/docs/mcp-agent-rules.mdx +41 -0
- package/docs/mcp-introduction.mdx +385 -0
- package/docs/mcp-tools.mdx +273 -0
- package/docs/migrating-from-v3.mdx +334 -0
- package/docs/observability/dashboards.mdx +102 -0
- package/docs/observability/query.mdx +585 -0
- package/docs/open-source-contributing.mdx +16 -0
- package/docs/open-source-self-hosting.mdx +541 -0
- package/docs/private-networking/aws-console-setup.mdx +304 -0
- package/docs/private-networking/overview.mdx +144 -0
- package/docs/private-networking/troubleshooting.mdx +78 -0
- package/docs/queue-concurrency.mdx +354 -0
- package/docs/quick-start.mdx +97 -0
- package/docs/realtime/auth.mdx +208 -0
- package/docs/realtime/backend/overview.mdx +45 -0
- package/docs/realtime/backend/streams.mdx +418 -0
- package/docs/realtime/backend/subscribe.mdx +225 -0
- package/docs/realtime/how-it-works.mdx +94 -0
- package/docs/realtime/overview.mdx +63 -0
- package/docs/realtime/react-hooks/overview.mdx +73 -0
- package/docs/realtime/react-hooks/streams.mdx +449 -0
- package/docs/realtime/react-hooks/subscribe.mdx +674 -0
- package/docs/realtime/react-hooks/swr.mdx +87 -0
- package/docs/realtime/react-hooks/triggering.mdx +194 -0
- package/docs/realtime/react-hooks/use-wait-token.mdx +34 -0
- package/docs/realtime/run-object.mdx +174 -0
- package/docs/replaying.mdx +72 -0
- package/docs/request-feature.mdx +6 -0
- package/docs/roadmap.mdx +6 -0
- package/docs/run-tests.mdx +20 -0
- package/docs/run-usage.mdx +113 -0
- package/docs/runs/heartbeats.mdx +38 -0
- package/docs/runs/max-duration.mdx +139 -0
- package/docs/runs/metadata.mdx +734 -0
- package/docs/runs/priority.mdx +31 -0
- package/docs/runs.mdx +396 -0
- package/docs/self-hosting/docker.mdx +458 -0
- package/docs/self-hosting/env/supervisor.mdx +74 -0
- package/docs/self-hosting/env/webapp.mdx +276 -0
- package/docs/self-hosting/kubernetes.mdx +601 -0
- package/docs/self-hosting/overview.mdx +108 -0
- package/docs/skills.mdx +85 -0
- package/docs/tags.mdx +120 -0
- package/docs/tasks/overview.mdx +697 -0
- package/docs/tasks/scheduled.mdx +382 -0
- package/docs/tasks/schemaTask.mdx +413 -0
- package/docs/tasks/streams.mdx +884 -0
- package/docs/triggering.mdx +1320 -0
- package/docs/troubleshooting-alerts.mdx +385 -0
- package/docs/troubleshooting-debugging-in-vscode.mdx +8 -0
- package/docs/troubleshooting-github-issues.mdx +6 -0
- package/docs/troubleshooting-uptime-status.mdx +6 -0
- package/docs/troubleshooting.mdx +398 -0
- package/docs/upgrading-packages.mdx +80 -0
- package/docs/vercel-integration.mdx +207 -0
- package/docs/versioning.mdx +56 -0
- package/docs/video-walkthrough.mdx +23 -0
- package/docs/wait-for-token.mdx +540 -0
- package/docs/wait-for.mdx +42 -0
- package/docs/wait-until.mdx +53 -0
- package/docs/wait.mdx +18 -0
- package/docs/writing-tasks-introduction.mdx +33 -0
- package/package.json +8 -5
- package/skills/trigger-authoring-chat-agent/SKILL.md +296 -0
- package/skills/trigger-authoring-tasks/SKILL.md +254 -0
- package/skills/trigger-chat-agent-advanced/SKILL.md +368 -0
- package/skills/trigger-cost-savings/SKILL.md +116 -0
- package/skills/trigger-realtime-and-frontend/SKILL.md +276 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Welcome to the Trigger.dev docs"
|
|
3
|
+
sidebarTitle: "Introduction"
|
|
4
|
+
description: "Find all the resources and guides you need to get started"
|
|
5
|
+
mode: "center"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<CardGroup cols={2}>
|
|
9
|
+
<Card title="Quick start" img="/images/intro-quickstart.jpg" href="/quick-start">
|
|
10
|
+
Get started with Trigger.dev and run your first task in 3 minutes
|
|
11
|
+
</Card>
|
|
12
|
+
<Card
|
|
13
|
+
title="Guides, frameworks & examples"
|
|
14
|
+
img="/images/intro-examples.jpg"
|
|
15
|
+
href="/guides/introduction#example-tasks"
|
|
16
|
+
>
|
|
17
|
+
Browse our wide range of guides, frameworks and example projects
|
|
18
|
+
</Card>
|
|
19
|
+
<Card title="Building with AI" img="/images/intro-ai.jpg" href="/building-with-ai">
|
|
20
|
+
Learn how to build Trigger.dev projects using AI coding assistants
|
|
21
|
+
</Card>
|
|
22
|
+
<Card title="Video walkthrough" img="/images/intro-video.jpg" href="/video-walkthrough">
|
|
23
|
+
Watch an end-to-end demo of Trigger.dev in 10 minutes
|
|
24
|
+
</Card>
|
|
25
|
+
</CardGroup>
|
|
26
|
+
|
|
27
|
+
## What is Trigger.dev?
|
|
28
|
+
|
|
29
|
+
Trigger.dev is an open source background jobs framework that lets you write reliable workflows in plain async code. Run long-running AI tasks, handle complex background jobs, and build AI agents with built-in queuing, automatic retries, and real-time monitoring. No timeouts, elastic scaling, and zero infrastructure management required.
|
|
30
|
+
|
|
31
|
+
We provide everything you need to build and manage background tasks: a CLI and SDK for writing tasks in your existing codebase, support for both [regular](/tasks/overview) and [scheduled](/tasks/scheduled) tasks, full observability through our dashboard, and a [Realtime API](/realtime) with [React hooks](/realtime/react-hooks#realtime-hooks) for showing task status in your frontend. You can use [Trigger.dev Cloud](https://cloud.trigger.dev) or [self-host](/self-hosting/overview) on your own infrastructure.
|
|
32
|
+
|
|
33
|
+
## Learn the concepts
|
|
34
|
+
|
|
35
|
+
<CardGroup cols={2}>
|
|
36
|
+
<Card title="Writing tasks" icon="wand-magic-sparkles" href="/tasks/overview" color="#3B82F6">
|
|
37
|
+
Tasks are the core of Trigger.dev. Learn what they are and how to write them.
|
|
38
|
+
</Card>
|
|
39
|
+
<Card title="Triggering tasks" icon="bullseye-pointer" href="/triggering" color="#fbbf24">
|
|
40
|
+
Learn how to trigger tasks from your codebase.
|
|
41
|
+
</Card>
|
|
42
|
+
<Card title="Runs" icon="person-running" href="/runs" color="#EA189E">
|
|
43
|
+
Runs are the instances of tasks that are executed. Learn how they work.
|
|
44
|
+
</Card>
|
|
45
|
+
<Card title="API keys" icon="key" href="/apikeys" color="#EAEA08">
|
|
46
|
+
API keys are used to authenticate requests to the Trigger.dev API. Learn how to create and use
|
|
47
|
+
them.
|
|
48
|
+
</Card>
|
|
49
|
+
</CardGroup>
|
|
50
|
+
|
|
51
|
+
## Explore by feature
|
|
52
|
+
|
|
53
|
+
<CardGroup>
|
|
54
|
+
<Card title="Scheduled tasks (cron)" icon="clock" href="/tasks/scheduled" color="#EAEA08">
|
|
55
|
+
Scheduled tasks are a type of task that is scheduled to run at a specific time.
|
|
56
|
+
</Card>
|
|
57
|
+
<Card title="Realtime API" icon="loader" href="/realtime" color="#22C55E">
|
|
58
|
+
The Realtime API allows you to trigger tasks and get the status of runs.
|
|
59
|
+
</Card>
|
|
60
|
+
<Card title="React hooks" icon="react" href="/realtime/react-hooks" color="#3B82F6">
|
|
61
|
+
React hooks are a way to show task status in your frontend.
|
|
62
|
+
</Card>
|
|
63
|
+
<Card title="Waits" icon="calendar-clock" href="/wait" color="#F59E0B">
|
|
64
|
+
Waits are a way to wait for a task to finish before continuing.
|
|
65
|
+
</Card>
|
|
66
|
+
<Card
|
|
67
|
+
title="Errors and retries"
|
|
68
|
+
icon="message-exclamation"
|
|
69
|
+
href="/errors-retrying"
|
|
70
|
+
color="#F43F5E"
|
|
71
|
+
>
|
|
72
|
+
Learn how to handle errors and retries.
|
|
73
|
+
</Card>
|
|
74
|
+
<Card title="Concurrency & Queues" icon="line-height" href="/queue-concurrency" color="#D946EF">
|
|
75
|
+
Configure what you want to happen when there is more than one run at a time.
|
|
76
|
+
</Card>
|
|
77
|
+
<Card
|
|
78
|
+
title="Wait for token (human-in-the-loop)"
|
|
79
|
+
icon="hand"
|
|
80
|
+
href="/wait-for-token"
|
|
81
|
+
color="#EAEA08"
|
|
82
|
+
>
|
|
83
|
+
Pause runs until a token is completed via an approval workflow.
|
|
84
|
+
</Card>
|
|
85
|
+
<Card title="Build extensions" icon="gear" href="/config/extensions/overview" color="#22C55E">
|
|
86
|
+
Customize the build process or the resulting bundle and container image.
|
|
87
|
+
</Card>
|
|
88
|
+
</CardGroup>
|
|
89
|
+
|
|
90
|
+
## Explore by build extension
|
|
91
|
+
|
|
92
|
+
| Extension | What it does | Docs |
|
|
93
|
+
| :-------------------- | :----------------------------------------------------------- | :----------------------------------------------------- |
|
|
94
|
+
| prismaExtension | Use Prisma with Trigger.dev | [Learn more](/config/extensions/prismaExtension) |
|
|
95
|
+
| pythonExtension | Execute Python scripts in Trigger.dev | [Learn more](/config/extensions/pythonExtension) |
|
|
96
|
+
| playwright | Use Playwright with Trigger.dev | [Learn more](/config/extensions/playwright) |
|
|
97
|
+
| puppeteer | Use Puppeteer with Trigger.dev | [Learn more](/config/extensions/puppeteer) |
|
|
98
|
+
| lightpanda | Use Lightpanda with Trigger.dev | [Learn more](/config/extensions/lightpanda) |
|
|
99
|
+
| ffmpeg | Use FFmpeg with Trigger.dev | [Learn more](/config/extensions/ffmpeg) |
|
|
100
|
+
| aptGet | Install system packages with aptGet | [Learn more](/config/extensions/aptGet) |
|
|
101
|
+
| additionalFiles | Copy additional files to the build directory | [Learn more](/config/extensions/additionalFiles) |
|
|
102
|
+
| additionalPackages | Include additional packages in the build | [Learn more](/config/extensions/additionalPackages) |
|
|
103
|
+
| syncEnvVars | Automatically sync environment variables to Trigger.dev | [Learn more](/config/extensions/syncEnvVars) |
|
|
104
|
+
| esbuildPlugin | Add existing or custom esbuild plugins to your build process | [Learn more](/config/extensions/esbuildPlugin) |
|
|
105
|
+
| emitDecoratorMetadata | Support for the emitDecoratorMetadata TypeScript compiler | [Learn more](/config/extensions/emitDecoratorMetadata) |
|
|
106
|
+
| audioWaveform | Support for Audio Waveform in your project | [Learn more](/config/extensions/audioWaveform) |
|
|
107
|
+
|
|
108
|
+
## Explore by example
|
|
109
|
+
|
|
110
|
+
<CardGroup cols={3}>
|
|
111
|
+
<Card
|
|
112
|
+
title="FFmpeg"
|
|
113
|
+
img="/images/intro-ffmpeg.jpg"
|
|
114
|
+
href="/guides/examples/ffmpeg-video-processing"
|
|
115
|
+
/>
|
|
116
|
+
<Card
|
|
117
|
+
title="Fal.ai"
|
|
118
|
+
img="/images/intro-fal.jpg"
|
|
119
|
+
href="/guides/examples/fal-ai-image-to-cartoon"
|
|
120
|
+
/>
|
|
121
|
+
<Card title="Puppeteer" img="/images/intro-puppeteer.jpg" href="/guides/examples/puppeteer" />
|
|
122
|
+
<Card
|
|
123
|
+
title="LibreOffice"
|
|
124
|
+
img="/images/intro-libreoffice.jpg"
|
|
125
|
+
href="/guides/examples/libreoffice-pdf-conversion"
|
|
126
|
+
/>
|
|
127
|
+
<Card
|
|
128
|
+
title="OpenAI"
|
|
129
|
+
img="/images/intro-openai.jpg"
|
|
130
|
+
href="/guides/examples/open-ai-with-retrying"
|
|
131
|
+
/>
|
|
132
|
+
<Card
|
|
133
|
+
title="Browserbase"
|
|
134
|
+
img="/images/intro-browserbase.jpg"
|
|
135
|
+
href="/guides/examples/scrape-hacker-news"
|
|
136
|
+
/>
|
|
137
|
+
<Card
|
|
138
|
+
title="Sentry"
|
|
139
|
+
img="/images/intro-sentry.jpg"
|
|
140
|
+
href="/guides/examples/sentry-error-tracking"
|
|
141
|
+
/>
|
|
142
|
+
<Card
|
|
143
|
+
title="Resend"
|
|
144
|
+
img="/images/intro-resend.jpg"
|
|
145
|
+
href="/guides/examples/resend-email-sequence"
|
|
146
|
+
/>
|
|
147
|
+
<Card
|
|
148
|
+
title="Vercel AI SDK"
|
|
149
|
+
img="/images/intro-vercel.jpg"
|
|
150
|
+
href="/guides/examples/vercel-ai-sdk"
|
|
151
|
+
/>
|
|
152
|
+
<Card
|
|
153
|
+
title="Sharp"
|
|
154
|
+
img="/images/intro-sharp.jpg"
|
|
155
|
+
href="/guides/examples/sharp-image-processing"
|
|
156
|
+
/>
|
|
157
|
+
<Card
|
|
158
|
+
title="Deepgram"
|
|
159
|
+
img="/images/intro-deepgram.jpg"
|
|
160
|
+
href="/guides/examples/deepgram-transcribe-audio"
|
|
161
|
+
/>
|
|
162
|
+
<Card
|
|
163
|
+
title="Supabase"
|
|
164
|
+
img="/images/intro-supabase.jpg"
|
|
165
|
+
href="/guides/examples/supabase-database-operations"
|
|
166
|
+
/>
|
|
167
|
+
<Card
|
|
168
|
+
title="DALL•E"
|
|
169
|
+
img="/images/intro-openai.jpg"
|
|
170
|
+
href="/guides/examples/dall-e3-generate-image"
|
|
171
|
+
/>
|
|
172
|
+
<Card
|
|
173
|
+
title="Firecrawl"
|
|
174
|
+
img="/images/intro-firecrawl.jpg"
|
|
175
|
+
href="/guides/examples/firecrawl-url-crawl"
|
|
176
|
+
/>
|
|
177
|
+
<Card title="Lightpanda" img="/images/intro-lightpanda.jpg" href="/guides/examples/lightpanda" />
|
|
178
|
+
</CardGroup>
|
|
179
|
+
|
|
180
|
+
## Getting help
|
|
181
|
+
|
|
182
|
+
We'd love to hear from you or give you a hand getting started. Here are some ways to get in touch with us.
|
|
183
|
+
|
|
184
|
+
<CardGroup>
|
|
185
|
+
<Card
|
|
186
|
+
title="Join our Discord server"
|
|
187
|
+
icon="discord"
|
|
188
|
+
href="https://discord.gg/kA47vcd8P6"
|
|
189
|
+
color="#5865F2"
|
|
190
|
+
>
|
|
191
|
+
Our Discord is the best place to get help with any questions about Trigger.dev.
|
|
192
|
+
</Card>
|
|
193
|
+
<Card
|
|
194
|
+
title="Follow us on X (Twitter)"
|
|
195
|
+
icon={
|
|
196
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 0 512 512">
|
|
197
|
+
<path d="M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z" />
|
|
198
|
+
</svg>
|
|
199
|
+
}
|
|
200
|
+
href="https://twitter.com/triggerdotdev"
|
|
201
|
+
color="#1DA1F2"
|
|
202
|
+
>
|
|
203
|
+
Follow us to get the latest updates and news.
|
|
204
|
+
</Card>
|
|
205
|
+
<Card
|
|
206
|
+
title="Schedule a call"
|
|
207
|
+
icon="phone"
|
|
208
|
+
iconType="solid"
|
|
209
|
+
color="#22C55E"
|
|
210
|
+
href="https://cal.com/team/triggerdotdev/founders-call"
|
|
211
|
+
>
|
|
212
|
+
Arrange a call with one of the founders to get help with any questions.
|
|
213
|
+
</Card>
|
|
214
|
+
<Card
|
|
215
|
+
title="Give us a star on GitHub"
|
|
216
|
+
icon="star"
|
|
217
|
+
iconType="solid"
|
|
218
|
+
href="https://github.com/triggerdotdev/trigger.dev"
|
|
219
|
+
color="#fbbf24"
|
|
220
|
+
>
|
|
221
|
+
Check us out our GitHub repo and give us a star if you like what we're doing.
|
|
222
|
+
</Card>
|
|
223
|
+
</CardGroup>
|
package/docs/limits.mdx
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Limits"
|
|
3
|
+
description: "There are some hard and soft limits that you might hit."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import RateLimitHitUseBatchTrigger from "/snippets/rate-limit-hit-use-batchtrigger.mdx";
|
|
7
|
+
|
|
8
|
+
You can view your current limits, quotas, and rate limit usage in real-time by visiting the **Limits** page in the dashboard (accessible from the left sidebar). This page shows current rate limit token availability, quota usage, and plan features for your organization.
|
|
9
|
+
|
|
10
|
+
## Concurrency limits
|
|
11
|
+
|
|
12
|
+
| Pricing tier | Limit |
|
|
13
|
+
| :----------- | :------------------- |
|
|
14
|
+
| Free | 10 concurrent runs |
|
|
15
|
+
| Hobby | 25 concurrent runs |
|
|
16
|
+
| Pro | 100+ concurrent runs |
|
|
17
|
+
|
|
18
|
+
Extra concurrency above the Pro tier limit is available via the dashboard. Click the "Concurrency" page from the left sidebar when on the Pro plan to purchase more.
|
|
19
|
+
|
|
20
|
+
## Rate limits
|
|
21
|
+
|
|
22
|
+
Generally speaking each SDK call is an API call.
|
|
23
|
+
|
|
24
|
+
| Limit | Details |
|
|
25
|
+
| :---- | :------------------------ |
|
|
26
|
+
| API | 1,500 requests per minute |
|
|
27
|
+
|
|
28
|
+
You can request a higher rate limit from us if you're on a paid plan.
|
|
29
|
+
|
|
30
|
+
<RateLimitHitUseBatchTrigger />
|
|
31
|
+
|
|
32
|
+
## Queued tasks
|
|
33
|
+
|
|
34
|
+
The maximum number of runs that can be queued **per queue** (not across all queues in the environment). Each queue can hold up to its limit independently. When a queue hits its limit, new triggers to that queue are rejected.
|
|
35
|
+
|
|
36
|
+
<Note>
|
|
37
|
+
The limits below apply to [Trigger.dev Cloud](https://trigger.dev). If you self-host Trigger.dev, queue size limits are configurable via the `MAXIMUM_DEV_QUEUE_SIZE` and `MAXIMUM_DEPLOYED_QUEUE_SIZE` environment variables — see [Self-hosting environment variables](/self-hosting/env/webapp#run-engine).
|
|
38
|
+
</Note>
|
|
39
|
+
|
|
40
|
+
| Pricing tier | Development (per queue) | Staging / Production (per queue) |
|
|
41
|
+
| :----------- | :---------------------- | :-------------------------------- |
|
|
42
|
+
| Free | 500 | 10,000 |
|
|
43
|
+
| Hobby | 500 | 250,000 |
|
|
44
|
+
| Pro | 5,000 | 1,000,000 |
|
|
45
|
+
|
|
46
|
+
## Maximum run TTL
|
|
47
|
+
|
|
48
|
+
On Trigger.dev Cloud, all runs have an enforced maximum TTL of 14 days. Runs without an explicit TTL automatically receive the 14-day TTL; runs with a TTL longer than 14 days are clamped to 14 days. This prevents queued runs from accumulating indefinitely. If you self-host, you can configure a maximum TTL via the `RUN_ENGINE_DEFAULT_MAX_TTL` environment variable — see [Self-hosting environment variables](/self-hosting/env/webapp#run-engine).
|
|
49
|
+
|
|
50
|
+
## Schedules
|
|
51
|
+
|
|
52
|
+
| Pricing tier | Limit |
|
|
53
|
+
| :----------- | :----------------- |
|
|
54
|
+
| Free | 10 per project |
|
|
55
|
+
| Hobby | 100 per project |
|
|
56
|
+
| Pro | 1,000+ per project |
|
|
57
|
+
|
|
58
|
+
Additional bundles above the Pro tier are available for $10/month per 1,000 schedules. Contact us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord) to request more.
|
|
59
|
+
|
|
60
|
+
When attaching schedules to tasks we strongly recommend you add them [in our dashboard](/tasks/scheduled#attaching-schedules-in-the-dashboard) if they're "static". That way you can control them easily per environment.
|
|
61
|
+
|
|
62
|
+
If you add them [dynamically using code](/management/schedules/create) make sure you add a `deduplicationKey` so you don't add the same schedule to a task multiple times. If you don't your task will get triggered multiple times, it will cost you more, and you will hit the limit.
|
|
63
|
+
|
|
64
|
+
If you're creating schedules for your user you will definitely need to request more schedules from us.
|
|
65
|
+
|
|
66
|
+
## Projects
|
|
67
|
+
|
|
68
|
+
| Pricing tier | Limit |
|
|
69
|
+
| :----------- | :------------------ |
|
|
70
|
+
| All tiers | 10 per organization |
|
|
71
|
+
|
|
72
|
+
Each project receives its own concurrency allocation. If you need to support multiple tenants with the same codebase but different environment variables, see the [Multi-tenant applications](/deploy-environment-variables#multi-tenant-applications) section for a recommended workaround.
|
|
73
|
+
|
|
74
|
+
## Preview branches
|
|
75
|
+
|
|
76
|
+
| Pricing tier | Limit |
|
|
77
|
+
| :----------- | :------------------- |
|
|
78
|
+
| Free | Not available |
|
|
79
|
+
| Hobby | 5 preview branches |
|
|
80
|
+
| Pro | 20+ preview branches |
|
|
81
|
+
|
|
82
|
+
Additional bundles above the Pro tier are available for $10/month per preview branch. Contact us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord) to request more.
|
|
83
|
+
|
|
84
|
+
## Realtime connections
|
|
85
|
+
|
|
86
|
+
| Pricing tier | Limit |
|
|
87
|
+
| :----------- | :-------------------------- |
|
|
88
|
+
| Free | 10 concurrent connections |
|
|
89
|
+
| Hobby | 50 concurrent connections |
|
|
90
|
+
| Pro | 500+ concurrent connections |
|
|
91
|
+
|
|
92
|
+
Additional bundles are available for $10/month per 100 concurrent connections. Contact us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord) to request more.
|
|
93
|
+
|
|
94
|
+
## Task payloads and outputs
|
|
95
|
+
|
|
96
|
+
| Limit | Details |
|
|
97
|
+
| :--------------------- | :----------------------------------------------------------------- |
|
|
98
|
+
| Single trigger payload | Must not exceed 3MB |
|
|
99
|
+
| Batch trigger payload | Each item can be up to 3MB (SDK 4.3.1+). Prior: 1MB total combined |
|
|
100
|
+
| Task outputs | Must not exceed 10MB |
|
|
101
|
+
|
|
102
|
+
Payloads and outputs that exceed 512KB will be offloaded to object storage and a presigned URL will be provided to download the data when calling `runs.retrieve`. You don't need to do anything to handle this in your tasks however, as we will transparently upload/download these during operation.
|
|
103
|
+
|
|
104
|
+
## Batch size
|
|
105
|
+
|
|
106
|
+
A single batch can have a maximum of 1,000 items with SDK 4.3.1+. Prior versions are limited to 500 items.
|
|
107
|
+
|
|
108
|
+
<SoftLimit />
|
|
109
|
+
|
|
110
|
+
## Batch trigger rate limits
|
|
111
|
+
|
|
112
|
+
Batch triggering uses a token bucket algorithm to rate limit the number of runs you can trigger per environment. Each run in a batch consumes one token.
|
|
113
|
+
|
|
114
|
+
| Pricing tier | Bucket size | Refill rate |
|
|
115
|
+
| :----------- | :---------- | :-------------------- |
|
|
116
|
+
| Free | 1,200 runs | 100 runs every 10 sec |
|
|
117
|
+
| Hobby | 5,000 runs | 500 runs every 5 sec |
|
|
118
|
+
| Pro | 5,000 runs | 500 runs every 5 sec |
|
|
119
|
+
|
|
120
|
+
**How it works**: You can burst up to your bucket size, then tokens refill at the specified rate. For example, a Free user can trigger 1,200 runs immediately, then must wait for tokens to refill (100 runs become available every 10 seconds).
|
|
121
|
+
|
|
122
|
+
<Note>
|
|
123
|
+
When you hit batch rate limits, the SDK throws a `BatchTriggerError` with `isRateLimited: true`.
|
|
124
|
+
See [Handling batch trigger errors](/triggering#handling-batch-trigger-errors) for how to detect
|
|
125
|
+
and react to rate limits in your code.
|
|
126
|
+
</Note>
|
|
127
|
+
|
|
128
|
+
## Batch trigger processing concurrency
|
|
129
|
+
|
|
130
|
+
When you send a batch trigger, we convert it into individual runs. This limit controls the maximum number of batches being converted into runs simultaneously per environment. It is not a limit on how many batch runs can be executing at once.
|
|
131
|
+
|
|
132
|
+
| Pricing tier | Limit |
|
|
133
|
+
| :----------- | :-------------------- |
|
|
134
|
+
| Free | 5 concurrent batches |
|
|
135
|
+
| Hobby | 10 concurrent batches |
|
|
136
|
+
| Pro | 50 concurrent batches |
|
|
137
|
+
|
|
138
|
+
## Log retention
|
|
139
|
+
|
|
140
|
+
| Pricing tier | Limit |
|
|
141
|
+
| :----------- | :------ |
|
|
142
|
+
| Free | 1 day |
|
|
143
|
+
| Hobby | 7 days |
|
|
144
|
+
| Pro | 30 days |
|
|
145
|
+
|
|
146
|
+
## Log size
|
|
147
|
+
|
|
148
|
+
We limit the size of logs to prevent oversized data potentially causing issues.
|
|
149
|
+
|
|
150
|
+
<Expandable title="log limits">
|
|
151
|
+
|
|
152
|
+
#### Attribute Limits
|
|
153
|
+
|
|
154
|
+
- Span Attribute Count Limit: 256
|
|
155
|
+
- Log Attribute Count Limit: 256
|
|
156
|
+
- Span Attribute Value Length Limit: 131072 characters
|
|
157
|
+
- Log Attribute Value Length Limit: 131072 characters
|
|
158
|
+
|
|
159
|
+
#### Event and Link Limits
|
|
160
|
+
|
|
161
|
+
- Span Event Count Limit: 10
|
|
162
|
+
- Link Count Limit: 2
|
|
163
|
+
- Attributes per Link Limit: 10
|
|
164
|
+
- Attributes per Event Limit: 10
|
|
165
|
+
|
|
166
|
+
#### I/O Packet Length Limit
|
|
167
|
+
|
|
168
|
+
128 KB (131,072 bytes)
|
|
169
|
+
|
|
170
|
+
#### Attribute Clipping Behavior
|
|
171
|
+
|
|
172
|
+
- Attributes exceeding the value length limit (1028 characters) are discarded.
|
|
173
|
+
- If the total number of attributes exceeds 256, additional attributes are not included.
|
|
174
|
+
|
|
175
|
+
#### Attribute Value Size Calculation
|
|
176
|
+
|
|
177
|
+
- Strings: Actual length of the string
|
|
178
|
+
- Numbers: 8 bytes
|
|
179
|
+
- Booleans: 4 bytes
|
|
180
|
+
- Arrays: Sum of the sizes of all elements
|
|
181
|
+
- Undefined or null: 0 bytes
|
|
182
|
+
|
|
183
|
+
</Expandable>
|
|
184
|
+
|
|
185
|
+
## Alerts
|
|
186
|
+
|
|
187
|
+
An alert destination is a single email address, Slack channel, or webhook URL that you want to send alerts to.
|
|
188
|
+
|
|
189
|
+
| Pricing tier | Limit |
|
|
190
|
+
| :----------- | :---------------------- |
|
|
191
|
+
| Free | 1 alert destination |
|
|
192
|
+
| Hobby | 3 alert destinations |
|
|
193
|
+
| Pro | 100+ alert destinations |
|
|
194
|
+
|
|
195
|
+
If you're on the Pro plan and need more than the plan limit, you can request more by contacting us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord).
|
|
196
|
+
|
|
197
|
+
## Query
|
|
198
|
+
|
|
199
|
+
Query execution is subject to the following limits:
|
|
200
|
+
|
|
201
|
+
| Limit | Details |
|
|
202
|
+
| :----------------- | :-------------------- |
|
|
203
|
+
| Max execution time | 10 seconds per query |
|
|
204
|
+
| Max result rows | 10,000 rows per query |
|
|
205
|
+
| Concurrent queries | 3 per project |
|
|
206
|
+
|
|
207
|
+
### Query lookback period
|
|
208
|
+
|
|
209
|
+
The maximum time range a query can look back is based on your plan:
|
|
210
|
+
|
|
211
|
+
| Pricing tier | Limit |
|
|
212
|
+
| :----------- | :------ |
|
|
213
|
+
| Free | 1 day |
|
|
214
|
+
| Hobby | 7 days |
|
|
215
|
+
| Pro | 30 days |
|
|
216
|
+
|
|
217
|
+
If your query's time range exceeds your plan's lookback limit, it will be automatically clipped to the maximum allowed period.
|
|
218
|
+
|
|
219
|
+
## Metric widget concurrency
|
|
220
|
+
|
|
221
|
+
The number of metric widgets that can be queried concurrently per project.
|
|
222
|
+
|
|
223
|
+
| Limit | Details |
|
|
224
|
+
| :------------------------ | :------------- |
|
|
225
|
+
| Concurrent widget queries | 30 per project |
|
|
226
|
+
|
|
227
|
+
## Machines
|
|
228
|
+
|
|
229
|
+
The default machine is `small-1x` which has 0.5 vCPU and 0.5 GB of RAM. You can optionally configure a higher spec machine which will increase the cost of running the task but can also improve the performance of the task if it is CPU or memory bound.
|
|
230
|
+
|
|
231
|
+
See the [machine configurations](/machines#machine-configurations) for more details.
|
|
232
|
+
|
|
233
|
+
## Team members
|
|
234
|
+
|
|
235
|
+
| Pricing tier | Limit |
|
|
236
|
+
| :----------- | :--------------- |
|
|
237
|
+
| Free | 5 team members |
|
|
238
|
+
| Hobby | 5 team members |
|
|
239
|
+
| Pro | 25+ team members |
|
|
240
|
+
|
|
241
|
+
Additional seats are available for $20/month per seat. Contact us via [email](https://trigger.dev/contact) or [Discord](https://trigger.dev/discord) to request more.
|
package/docs/logging.mdx
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Logging, tracing & metrics"
|
|
3
|
+
description: "How to use the built-in logging, tracing, and metrics system."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
The run log shows you exactly what happened in every run of your tasks. It is comprised of logs, traces and spans.
|
|
9
|
+
|
|
10
|
+
## Logs
|
|
11
|
+
|
|
12
|
+
You can use `console.log()`, `console.error()`, etc as normal and they will be shown in your run log. This is the standard function so you can use it as you would in any other JavaScript or TypeScript code. Logs from any functions/packages will also be shown.
|
|
13
|
+
|
|
14
|
+
### logger
|
|
15
|
+
|
|
16
|
+
We recommend that you use our `logger` object which creates structured logs. Structured logs will make it easier for you to search the logs to quickly find runs.
|
|
17
|
+
|
|
18
|
+
```ts /trigger/logging.ts
|
|
19
|
+
import { task, logger } from "@trigger.dev/sdk";
|
|
20
|
+
|
|
21
|
+
export const loggingExample = task({
|
|
22
|
+
id: "logging-example",
|
|
23
|
+
run: async (payload: { data: Record<string, string> }) => {
|
|
24
|
+
//the first parameter is the message, the second parameter must be a key-value object (Record<string, unknown>)
|
|
25
|
+
logger.debug("Debug message", payload.data);
|
|
26
|
+
logger.log("Log message", payload.data);
|
|
27
|
+
logger.info("Info message", payload.data);
|
|
28
|
+
logger.warn("You've been warned", payload.data);
|
|
29
|
+
logger.error("Error message", payload.data);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Tracing and spans
|
|
35
|
+
|
|
36
|
+
Tracing is a way to follow the flow of your code. It's very useful for debugging and understanding how your code is working, especially with long-running or complex tasks.
|
|
37
|
+
|
|
38
|
+
Trigger.dev uses OpenTelemetry tracing under the hood. With automatic tracing for many things like task triggering, task attempts, HTTP requests, and more.
|
|
39
|
+
|
|
40
|
+
| Name | Description |
|
|
41
|
+
| :------------ | :------------------------------- |
|
|
42
|
+
| Task triggers | Task triggers |
|
|
43
|
+
| Task attempts | Task attempts |
|
|
44
|
+
| HTTP requests | HTTP requests made by your code. |
|
|
45
|
+
|
|
46
|
+
### Adding instrumentations
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
You can [add instrumentations](/config/config-file#instrumentations). The Prisma one above will automatically trace all Prisma queries.
|
|
51
|
+
|
|
52
|
+
### Add custom traces
|
|
53
|
+
|
|
54
|
+
If you want to add custom traces to your code, you can use the `logger.trace` function. It will create a new OTEL trace and you can set attributes on it.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { logger, task } from "@trigger.dev/sdk";
|
|
58
|
+
|
|
59
|
+
export const customTrace = task({
|
|
60
|
+
id: "custom-trace",
|
|
61
|
+
run: async (payload) => {
|
|
62
|
+
//you can wrap code in a trace, and set attributes
|
|
63
|
+
const user = await logger.trace("fetch-user", async (span) => {
|
|
64
|
+
span.setAttribute("user.id", "1");
|
|
65
|
+
|
|
66
|
+
//...do stuff
|
|
67
|
+
|
|
68
|
+
//you can return a value
|
|
69
|
+
return {
|
|
70
|
+
id: "1",
|
|
71
|
+
name: "John Doe",
|
|
72
|
+
fetchedAt: new Date(),
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const usersName = user.name;
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Metrics
|
|
82
|
+
|
|
83
|
+
Trigger.dev collects system and runtime metrics automatically for deployed tasks, and provides an API for recording custom metrics using OpenTelemetry.
|
|
84
|
+
|
|
85
|
+
You can view metrics in the [Dashboards](/observability/dashboards), query them with [TRQL](/observability/query), and export them to external services via [telemetry exporters](/config/config-file#telemetry-exporters).
|
|
86
|
+
|
|
87
|
+
### Custom metrics API
|
|
88
|
+
|
|
89
|
+
Import `otel` from `@trigger.dev/sdk` and use the standard OpenTelemetry Metrics API to create custom instruments.
|
|
90
|
+
|
|
91
|
+
Create instruments **at module level** (outside the task `run` function) so they are reused across runs:
|
|
92
|
+
|
|
93
|
+
```ts /trigger/metrics.ts
|
|
94
|
+
import { task, logger, otel } from "@trigger.dev/sdk";
|
|
95
|
+
|
|
96
|
+
// Create a meter — instruments are created once at module level
|
|
97
|
+
const meter = otel.metrics.getMeter("my-app");
|
|
98
|
+
|
|
99
|
+
const itemsProcessed = meter.createCounter("items.processed", {
|
|
100
|
+
description: "Total number of items processed",
|
|
101
|
+
unit: "items",
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const itemDuration = meter.createHistogram("item.duration", {
|
|
105
|
+
description: "Time spent processing each item",
|
|
106
|
+
unit: "ms",
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const queueDepth = meter.createUpDownCounter("queue.depth", {
|
|
110
|
+
description: "Current queue depth",
|
|
111
|
+
unit: "items",
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const processQueue = task({
|
|
115
|
+
id: "process-queue",
|
|
116
|
+
run: async (payload: { items: string[] }) => {
|
|
117
|
+
queueDepth.add(payload.items.length);
|
|
118
|
+
|
|
119
|
+
for (const item of payload.items) {
|
|
120
|
+
const start = performance.now();
|
|
121
|
+
|
|
122
|
+
// ... process item ...
|
|
123
|
+
|
|
124
|
+
const elapsed = performance.now() - start;
|
|
125
|
+
|
|
126
|
+
itemsProcessed.add(1, { "item.type": "order" });
|
|
127
|
+
itemDuration.record(elapsed, { "item.type": "order" });
|
|
128
|
+
queueDepth.add(-1);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
logger.info("Queue processed", { count: payload.items.length });
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### Available instrument types
|
|
137
|
+
|
|
138
|
+
| Instrument | Method | Use case |
|
|
139
|
+
| :--- | :--- | :--- |
|
|
140
|
+
| Counter | `meter.createCounter()` | Monotonically increasing values (items processed, requests sent) |
|
|
141
|
+
| Histogram | `meter.createHistogram()` | Distributions of values (durations, sizes) |
|
|
142
|
+
| UpDownCounter | `meter.createUpDownCounter()` | Values that go up and down (queue depth, active connections) |
|
|
143
|
+
|
|
144
|
+
All instruments accept optional attributes when recording values. Attributes let you break down metrics by dimension (e.g., by item type, status, or region).
|
|
145
|
+
|
|
146
|
+
### Automatic system and runtime metrics
|
|
147
|
+
|
|
148
|
+
Trigger.dev automatically collects the following metrics for deployed tasks. No configuration is needed. Requires SDK version **4.4.1 or later**.
|
|
149
|
+
|
|
150
|
+
| Metric name | Type | Unit | Description |
|
|
151
|
+
| :--- | :--- | :--- | :--- |
|
|
152
|
+
| `process.cpu.utilization` | gauge | ratio | Process CPU usage (0-1) |
|
|
153
|
+
| `process.cpu.time` | counter | seconds | CPU time consumed |
|
|
154
|
+
| `process.memory.usage` | gauge | bytes | Process memory usage |
|
|
155
|
+
| `nodejs.event_loop.utilization` | gauge | ratio | Event loop utilization (0-1) |
|
|
156
|
+
| `nodejs.event_loop.delay.p95` | gauge | seconds | Event loop delay p95 |
|
|
157
|
+
| `nodejs.event_loop.delay.max` | gauge | seconds | Event loop delay max |
|
|
158
|
+
| `nodejs.heap.used` | gauge | bytes | V8 heap used |
|
|
159
|
+
| `nodejs.heap.total` | gauge | bytes | V8 heap total |
|
|
160
|
+
|
|
161
|
+
<Note>
|
|
162
|
+
In dev mode (`trigger dev`), only `process.*` and custom metrics are available.
|
|
163
|
+
</Note>
|
|
164
|
+
|
|
165
|
+
### Context attributes
|
|
166
|
+
|
|
167
|
+
All metrics (both automatic and custom) are tagged with run context so you can filter and group them:
|
|
168
|
+
|
|
169
|
+
- `run_id` — the run that produced the metric
|
|
170
|
+
- `task_identifier` — the task slug
|
|
171
|
+
- `attempt_number` — the attempt number
|
|
172
|
+
- `machine_name` — the machine preset (e.g., `small-1x`)
|
|
173
|
+
- `worker_version` — the deployed worker version
|
|
174
|
+
- `environment_type` — `PRODUCTION`, `STAGING`, `DEVELOPMENT`, or `PREVIEW`
|
|
175
|
+
|
|
176
|
+
### Querying metrics
|
|
177
|
+
|
|
178
|
+
Use [TRQL](/observability/query) to query metrics data. For example, to see average CPU utilization over time:
|
|
179
|
+
|
|
180
|
+
```sql
|
|
181
|
+
SELECT
|
|
182
|
+
timeBucket(),
|
|
183
|
+
avg(value) AS avg_cpu
|
|
184
|
+
FROM metrics
|
|
185
|
+
WHERE metric_name = 'process.cpu.utilization'
|
|
186
|
+
GROUP BY timeBucket
|
|
187
|
+
ORDER BY timeBucket
|
|
188
|
+
LIMIT 1000
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
See the [Query page](/observability/query#metrics-table-columns) for the full `metrics` table schema.
|
|
192
|
+
|
|
193
|
+
### Exporting metrics
|
|
194
|
+
|
|
195
|
+
You can send metrics to external observability services (Axiom, Honeycomb, Datadog, etc.) by configuring [telemetry exporters](/config/config-file#telemetry-exporters) in your `trigger.config.ts`.
|