Skip to content

feat(vercel-ai): Add rerank support and fix token attribute mapping #19145

@github-actions

Description

@github-actions

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 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/outputTokensgen_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

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions