Commit 1442c2b
fix(core): Remove check and always respect ai.telemetry.functionId for Vercel AI gen spans (getsentry#17811)
This PR fixes a mismatch between ai.telemetry.functionId and
gen_ai.function_id. Function ids were ignored unless the span name
contained exactly one dot. This caused:
- gen_ai.function_id to be missing or inconsistent for valid generation
spans.
- Mismatch between ai.telemetry.functionId and gen_ai.function_id,
making trace exploration and metrics harder to interpret.
We now always respect experimental_telemetry.functionId when present,
where function id could be set as part of request.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Always update Vercel AI generate span names and set
`gen_ai.function_id` when `experimental_telemetry.functionId` is
present, removing the dot-count check.
>
> - **Core (Vercel AI span processing)**:
> - In `packages/core/src/utils/vercel-ai/index.ts`
`processGenerateSpan`:
> - Remove `name.split('.')` dot-count check; always apply
`experimental_telemetry.functionId`.
> - When present, append function ID to the operation name and set
`gen_ai.function_id`.
> - Clarify comments on telemetry function ID usage.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4b9fa48. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 8dacdfb commit 1442c2b
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
| 182 | + | |
182 | 183 | | |
183 | | - | |
| 184 | + | |
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| |||
0 commit comments