Commit 78201a7
committed
fix(native-spans): normalize core span fields before native export
The v0.4 encoder runs `normalizeSpan` on every span as it encodes
(`encode/0.4.js` selects it as the per-span formatter), so the JS
pipeline never ships a span missing the intake defaults or exceeding the
100-character caps on service, name and type. The native path wrote
`formatted.name` / `.service` / `.type` straight into WASM, making it the
only pipeline that could emit un-normalized core fields — so a
high-cardinality route name went out at full length.
Apply the same pass at the native write, after the stats snapshot, which
matches the legacy ordering where normalization happens at encode time
rather than at finish.
Reported by Codex review as P2. Note the report also mentions the 5,000
character resource cap; that is `truncateSpan`, which the v0.4 agent path
does not apply either (only the electron and agentless encoders do), so
it is deliberately left alone.1 parent e6dfb9f commit 78201a7
2 files changed
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
317 | 325 | | |
318 | 326 | | |
319 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
139 | 164 | | |
140 | 165 | | |
141 | 166 | | |
| |||
0 commit comments