Summary
This PR adds support for the Vercel AI SDK rerank operation and fixes token attribute mapping to follow OpenTelemetry semantic conventions.
Changes
Core (@sentry/core):
- Add
ai.rerank span support in the Vercel AI span processor
- Map
ai.usage.inputTokens/outputTokens → gen_ai.usage.input_tokens/output_tokens
- Map
ai.response.avgOutputTokensPerSecond → standardized attribute name
- Add tests for rerank and token mapping
Node (@sentry/node):
- Add
rerank to INSTRUMENTED_METHODS to auto-enable telemetry for rerank operations
Checklist
Note
The pull request "feat(vercel-ai): Add rerank support and fix token attribute mapping" was created by @sergical but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.
Summary
This PR adds support for the Vercel AI SDK
rerankoperation and fixes token attribute mapping to follow OpenTelemetry semantic conventions.Changes
Core (
@sentry/core):ai.rerankspan support in the Vercel AI span processorai.usage.inputTokens/outputTokens→gen_ai.usage.input_tokens/output_tokensai.response.avgOutputTokensPerSecond→ standardized attribute nameNode (
@sentry/node):reranktoINSTRUMENTED_METHODSto auto-enable telemetry for rerank operationsChecklist
yarn lint) & (yarn test).