Commit ce49d5b
feat(node): Add eveInstrumentation and eveIntegration for eve apps (#24539)
eve 0.62/0.63 changed its instrumentation contract in two ways that
broke the `node-eve` e2e app and made gen_ai content capture awkward: a
flat `agent/instrumentation.ts` is no longer discovered (it must live
under `agent/instrumentation/<provider>.ts` and export
`defineInstrumentation(...)`), and eve now stamps every AI SDK call with
`recordInputs`/`recordOutputs: false`. That per-call flag on the
`ai:telemetry` channel outranks the global `dataCollection.genAI`
setting, so gen_ai message content was silently dropped — the only
escape was setting `recordInputs`/`recordOutputs` per integration, which
is poor DX.
This adds two APIs in `@sentry/server-utils`, re-exported from the
runtime packages:
- **`eveIntegration()`** — marks the client so the Vercel AI channel
subscriber records gen_ai inputs/outputs by default under eve. An
explicit `dataCollection.genAI` or `vercelAIIntegration({ recordInputs
})` still take precedence.
- **`Sentry.eveInstrumentation(options)`** (in `@sentry/node`) — an
all-in-one provider for a single `agent/instrumentation/*.ts` file. It
runs `Sentry.init` (adding `eveIntegration`) at server startup and tags
each turn's AI spans with the eve session id as the Sentry conversation
id via `turn.started` / `step.attempt.started` events, replacing the
separate `eveConversationHook` file. Accepts `getConversationId` to
customize the id.
The `node-eve` e2e app is migrated to eve `^0.63.0` and the new
single-file setup.
## New Usage
```ts
// agent/instrumentation/sentry.ts
import * as Sentry from '@sentry/node';
import { defineInstrumentation } from 'eve/instrumentation';
export default defineInstrumentation(
Sentry.eveInstrumentation({
dsn: process.env.E2E_TEST_DSN,
tracesSampleRate: 1.0,
}),
);
```
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Jan Peer Stöcklmair <jan.oster94@gmail.com>1 parent c016c09 commit ce49d5b
20 files changed
Lines changed: 284 additions & 36 deletions
File tree
- dev-packages/e2e-tests/test-applications/node-eve
- agent
- hooks
- instrumentation
- tests
- packages
- astro/src
- aws-serverless/src
- bun/src
- cloudflare/src
- deno/src
- google-cloud-serverless/src
- node
- src
- test
- server-utils
- src
- integrations/vercel-ai
- test
- integrations/vercel-ai
Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
178 | 180 | | |
179 | 181 | | |
180 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
| 195 | + | |
| 196 | + | |
195 | 197 | | |
196 | 198 | | |
197 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
0 commit comments