feat(node): Add @vercel/ai instrumentation#13892
Merged
AbhiPrasad merged 11 commits intodevelopfrom Dec 9, 2024
Merged
Conversation
Contributor
size-limit report 📦
|
38cb4d4 to
bdc3543
Compare
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
s1gr1d
approved these changes
Nov 28, 2024
Comment on lines
+161
to
+166
| * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library. | ||
| * | ||
| * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry). | ||
| * | ||
| * @example | ||
| * ```javascript |
Lms24
approved these changes
Dec 2, 2024
Member
Lms24
left a comment
There was a problem hiding this comment.
Just once concern, otherwise LGTM!
| attributes['ai.usage.completionTokens'] != undefined && | ||
| attributes['ai.usage.promptTokens'] != undefined | ||
| ) { | ||
| span.data['ai.tokens.used'] = attributes['ai.usage.completionTokens'] + attributes['ai.usage.promptTokens']; |
Member
There was a problem hiding this comment.
looking at our LLM monitoring attribute spec, should this rather be:
Suggested change
| span.data['ai.tokens.used'] = attributes['ai.usage.completionTokens'] + attributes['ai.usage.promptTokens']; | |
| span.data['ai.total_tokens.used'] = attributes['ai.usage.completionTokens'] + attributes['ai.usage.promptTokens']; |
? Not sure though, maybe there's another spec somewhere for this attribute?
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Sentry tracing instrumentation for the ai library.
For more information, see the
aidocumentation.By default this integration adds tracing support to all
aicallsites. If you need to disablecollecting spans for a specific call, you can do so by setting
experimental_telemetry.isEnabledtofalsein the first argument of the function call.If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each
function call by setting
experimental_telemetry.recordInputsandexperimental_telemetry.recordOutputsto
true.resolves #13679