Commit b02fa2b
committed
feat(eve): add braintrustEveProvider for eve's instrumentation bridge
Add a new Braintrust instrumentation provider that consumes eve's
lifecycle event bus (session/turn/step/model-call/action events)
instead of parsing stream events manually. The provider declares
capture: "content" or "metadata" and maps lifecycle events directly
to Braintrust spans, using eve's replay-stable idempotency keys for
deterministic span IDs and ctx.state for durable per-operation state.
Content redaction follows eve's per-destination ContentOptions model:
recordInputs and recordOutputs default to false, so the provider
captures metadata only (structure, identity, usage, timing) unless the
caller opts in. When both are false, the provider declares capture:
"metadata" so eve never builds the content projection at all. When
either is true, the provider declares capture: "content" and
respects its own redaction policy in each handler.
The version branching is internal to the SDK. braintrustEveInstrumentation
detects eve >= 0.34.0 at module scope and delegates to the provider
implementation; braintrustEveHook becomes a no-op on new eve since the
provider handles everything. The user's code does not change — they keep
importing braintrustEveInstrumentation and braintrustEveHook and passing
defineState, and the SDK uses the right path automatically.
New files:
- js/src/vendor-sdk-types/eve-provider.ts: vendored lifecycle event types
- js/src/instrumentation/plugins/eve-provider.ts: provider implementation
Signed-off-by: Chad Hietala <chadhietala@gmail.com>1 parent ae76882 commit b02fa2b
6 files changed
Lines changed: 1285 additions & 4 deletions
File tree
- e2e/scenarios/eve-instrumentation/agent
- js/src
- instrumentation
- plugins
- vendor-sdk-types
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
203 | 208 | | |
204 | 209 | | |
205 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
115 | 145 | | |
116 | 146 | | |
117 | 147 | | |
118 | 148 | | |
119 | 149 | | |
120 | 150 | | |
121 | 151 | | |
122 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
123 | 159 | | |
124 | 160 | | |
125 | 161 | | |
126 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
127 | 166 | | |
128 | 167 | | |
129 | 168 | | |
| |||
135 | 174 | | |
136 | 175 | | |
137 | 176 | | |
138 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
139 | 189 | | |
140 | 190 | | |
| 191 | + | |
| 192 | + | |
141 | 193 | | |
142 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
143 | 204 | | |
144 | 205 | | |
145 | 206 | | |
| |||
151 | 212 | | |
152 | 213 | | |
153 | 214 | | |
154 | | - | |
155 | | - | |
| 215 | + | |
| 216 | + | |
156 | 217 | | |
157 | 218 | | |
158 | 219 | | |
| |||
0 commit comments