-
Notifications
You must be signed in to change notification settings - Fork 412
feat: @google/genai
Gemini AI LLM instrumentation
#3119
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
base: main
Are you sure you want to change the base?
feat: @google/genai
Gemini AI LLM instrumentation
#3119
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3119 +/- ##
==========================================
- Coverage 80.27% 80.27% -0.01%
==========================================
Files 322 328 +6
Lines 49103 49558 +455
==========================================
+ Hits 39419 39781 +362
- Misses 9684 9777 +93
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
It'll take some time to go through the actual code. But I wanted to get this style feedback over sooner rather than later.
@google/gen-ai
Gemini AI LLM instrumentation@google/genai
Gemini AI LLM instrumentation
Co-authored-by: Maurice Rickard <[email protected]>
this['error.message'] = cause?.message | ||
this['error.code'] = response?.code ?? cause?.error?.code | ||
this['error.code'] = response?.code ?? cause?.error?.code ?? parsedError?.code |
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.
...though if we define parsedError
from cause.message
, we'll need to change this reference to parsedError.code
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.
I think it's better to set parsedError to undefined that way we don't attempt to set http.statusCode or error.code if that value doesn't actually exist.
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.
And it's true that we're capturing cause.message
in error.message
.
I'd recommend we add one test of a malformed cause.message
string in test/versioned/google-genai/mock-responses.js
, just to make sure that this error handling does what we think it does.
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.
Yup I added that test in test/unit/llm-events/google-genai/error.test.js
per James' suggestion
This PR closes #2890. This instruments the
@google/genai
library which provides an SDK for Google's Gemini AI.For reviewers, refer to:
@google/genai
repo