-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Document Google Gen AI Integration #15061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 34.12kB (0.15%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
view changes for bundle: sentry-docs-server-cjsAssets Changed:
|
docs/platforms/javascript/common/configuration/integrations/google-genai.mdx
Outdated
Show resolved
Hide resolved
| </PlatformLink> | ||
| - <PlatformLink to="/configuration/integrations/openai/">OpenAI</PlatformLink> | ||
| - <PlatformLink to="/configuration/integrations/anthropic/">Anthropic</PlatformLink> | ||
| - <PlatformLink to="/configuration/integrations/anthropic">Anthropic</PlatformLink> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Not sure if this was intended, but this one is now missing a trailing slash
Lms24
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had some suggestions and questions but nothing totally blocking. Happy to leave everything up to you but maybe we can just get some clarification on the nextjs section.
| ## Supported Versions | ||
|
|
||
| - `@google/genai`: `>=0.10.0 <2` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: I'd probably move this down beneath the intro section because otherwise, the intro paragraph belongs to the "Supported Versions" heading
| const genAI = new GoogleGenAI(process.env.API_KEY); | ||
| const client = Sentry.instrumentGoogleGenAIClient(genAI, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super-l: General question (not just this snippet) Is client also mentioned by the regular google documentation for how to use the library? if they use a different common name, I'd rather go with that, just to keep things familiar for users.
Maybe this
| const genAI = new GoogleGenAI(process.env.API_KEY); | |
| const client = Sentry.instrumentGoogleGenAIClient(genAI, { | |
| const originialGenAI = new GoogleGenAI(process.env.API_KEY); | |
| const genAI = Sentry.instrumentGoogleGenAIClient(originialGenAI, { |
or
| const genAI = new GoogleGenAI(process.env.API_KEY); | |
| const client = Sentry.instrumentGoogleGenAIClient(genAI, { | |
| const genAI = new GoogleGenAI(process.env.API_KEY); | |
| const instrumentedGenAi = Sentry.instrumentGoogleGenAIClient(genAI, { |
happy to go with whatever makes most sense. If client is that, then no need to change anything 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They use ai https://www.npmjs.com/package/@google/genai (which i'd rather not use because Vercel's package is ai) andclient https://googleapis.github.io/python-genai/ interchangeably, but mos actually refer to ai as client!
|
|
||
| The `googleGenAIIntegration` adds instrumentation for the `@google/genai` SDK to capture spans by automatically wrapping Google Gen AI client calls and recording LLM interactions with configurable input/output recording. | ||
|
|
||
| <PlatformSection notSupported={["javascript.cloudflare", "javascript.nextjs"]}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this section also be visible for Next.JS? IIUC only the edge runtime needs the other setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for edge runtime, we are handling this down in a <PlatformSection supported={['javascript.nextjs']}> section
| import * as Sentry from "@sentry/cloudflare"; | ||
| import { GoogleGenAI } from "@google/genai"; | ||
|
|
||
| const genAI = new GoogleGenAI(process.env.API_KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Incorrect Environment Variable Access in Code Examples
The code examples for Cloudflare Workers and Next.js Edge runtime incorrectly use process.env.API_KEY. These environments have restricted or different mechanisms for accessing environment variables, so process.env isn't the correct approach here.
DESCRIBE YOUR PR
Documents Google Gen AI integration
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES