Skip to content

Commit d3053a3

Browse files
committed
quick comments
1 parent 7f9b83a commit d3053a3

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

dev-packages/node-integration-tests/suites/tracing/google-genai/instrument-with-pii.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Sentry.init({
77
tracesSampleRate: 1.0,
88
sendDefaultPii: true,
99
transport: loggingTransport,
10-
integrations: [Sentry.googleGenAIIntegration()],
1110
beforeSendTransaction: event => {
1211
// Filter out mock express server transactions
1312
if (event.transaction.includes('/v1beta/')) {

dev-packages/node-integration-tests/suites/tracing/google-genai/instrument.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Sentry.init({
77
tracesSampleRate: 1.0,
88
sendDefaultPii: false,
99
transport: loggingTransport,
10-
integrations: [Sentry.googleGenAIIntegration()],
1110
beforeSendTransaction: event => {
1211
// Filter out mock express server transactions
1312
if (event.transaction.includes('/v1beta')) {

packages/core/src/utils/google-genai/types.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,6 @@ export interface GoogleGenAIChat {
179179
sendMessageStream: (...args: unknown[]) => Promise<AsyncGenerator<GenerateContentResponse, any, unknown>>;
180180
}
181181

182-
/**
183-
* Google GenAI Integration interface for type safety
184-
*/
185-
export interface GoogleGenAIIntegration {
186-
name: string;
187-
options: GoogleGenAIOptions;
188-
}
189-
190182
export type GoogleGenAIIstrumentedMethod = (typeof GOOGLE_GENAI_INSTRUMENTED_METHODS)[number];
191183

192184
// Export the response type for use in instrumentation

packages/node/src/integrations/tracing/google-genai/instrumentation.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export class SentryGoogleGenAiInstrumentation extends InstrumentationBase<Google
3737
supportedVersions,
3838
exports => this._patch(exports),
3939
exports => exports,
40+
// In CJS, @google/genai re-exports from (dist/node/index.cjs) file.
41+
// Patching only the root module sometimes misses the real implementation or
42+
// gets overwritten when that file is loaded. We add a file-level patch so that
43+
// _patch runs again on the concrete implementation
4044
[
4145
new InstrumentationNodeModuleFile(
4246
'@google/genai/dist/node/index.cjs',
@@ -57,7 +61,7 @@ export class SentryGoogleGenAiInstrumentation extends InstrumentationBase<Google
5761
const config = this.getConfig();
5862

5963
if (typeof Original !== 'function') {
60-
return;
64+
return exports;
6165
}
6266

6367
const WrappedGoogleGenAI = function (this: unknown, ...args: unknown[]): GoogleGenAIClient {

0 commit comments

Comments
 (0)