Skip to content

Conversation

@RulaKhaled
Copy link
Member

@RulaKhaled RulaKhaled commented Sep 16, 2025

✅ This PR depends on #17625 and it should be reviewed only after that one is merged.

This PR adds:

  1. Streaming support for Google GenAI sdk instrumenting the following methods:

    1. Models API Streaming

      • models.generateContentStream() - Stream content generation with real-time chunks
    2. Chat API Streaming (chats.create)

      • chat.sendMessageStream() - Stream chat responses with conversation context
  2. New tool calls attributes

    • GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE - Captures available tools from requests
    • GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE - Captures function calls from responses
@github-actions
Copy link
Contributor

github-actions bot commented Sep 16, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.23 kB - -
@sentry/browser - with treeshaking flags 22.75 kB - -
@sentry/browser (incl. Tracing) 40.42 kB - -
@sentry/browser (incl. Tracing, Replay) 78.8 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.45 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.47 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.67 kB - -
@sentry/browser (incl. Feedback) 40.95 kB - -
@sentry/browser (incl. sendFeedback) 28.89 kB - -
@sentry/browser (incl. FeedbackAsync) 33.82 kB - -
@sentry/react 25.95 kB -0.02% -5 B 🔽
@sentry/react (incl. Tracing) 42.39 kB - -
@sentry/vue 28.75 kB - -
@sentry/vue (incl. Tracing) 42.23 kB - -
@sentry/svelte 24.26 kB - -
CDN Bundle 25.75 kB - -
CDN Bundle (incl. Tracing) 40.31 kB - -
CDN Bundle (incl. Tracing, Replay) 76.55 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 82.06 kB - -
CDN Bundle - uncompressed 75.3 kB - -
CDN Bundle (incl. Tracing) - uncompressed 119.31 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 234.47 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 247.23 kB - -
@sentry/nextjs (client) 44.4 kB - -
@sentry/sveltekit (client) 40.84 kB - -
@sentry/node-core 50.47 kB -0.01% -2 B 🔽
@sentry/node 154.09 kB +0.34% +520 B 🔺
@sentry/node - without tracing 92.33 kB -0.01% -1 B 🔽
@sentry/aws-serverless 106.03 kB -0.01% -2 B 🔽

View base workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Sep 16, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,707 - 8,569 +2%
GET With Sentry 1,325 15% 1,326 -0%
GET With Sentry (error only) 6,007 69% 5,842 +3%
POST Baseline 1,182 - 1,140 +4%
POST With Sentry 501 42% 490 +2%
POST With Sentry (error only) 1,046 88% 1,024 +2%
MYSQL Baseline 3,304 - 3,199 +3%
MYSQL With Sentry 441 13% 507 -13%
MYSQL With Sentry (error only) 2,671 81% 2,580 +4%

View base workflow run

@RulaKhaled RulaKhaled force-pushed the instrument-genai-google-stream branch from 6191940 to 3e617c7 Compare September 16, 2025 12:45
@RulaKhaled RulaKhaled changed the title feat(core): Support stream responses for Google GenAI feat(core): Support stream responses and tool calls for Google GenAI Sep 16, 2025
@RulaKhaled RulaKhaled changed the title feat(core): Support stream responses and tool calls for Google GenAI WIP feat(core): Support stream responses and tool calls for Google GenAI Sep 19, 2025
@RulaKhaled RulaKhaled force-pushed the instrument-genai-google-stream branch from 8f8e784 to 25d87ea Compare September 19, 2025 13:37
@RulaKhaled RulaKhaled marked this pull request as ready for review September 22, 2025 06:36
cursor[bot]

This comment was marked as outdated.

@RulaKhaled RulaKhaled force-pushed the instrument-genai-google-stream branch from dcb208a to 1baed6e Compare September 22, 2025 06:53
@RulaKhaled RulaKhaled changed the title WIP feat(core): Support stream responses and tool calls for Google GenAI feat(core): Support stream responses and tool calls for Google GenAI Sep 22, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

RulaKhaled and others added 2 commits October 1, 2025 15:58
…i/scenario-streaming.mjs Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com>
…i/scenario-streaming.mjs Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com>
@RulaKhaled RulaKhaled merged commit b830cb2 into develop Oct 1, 2025
366 of 371 checks passed
@RulaKhaled RulaKhaled deleted the instrument-genai-google-stream branch October 1, 2025 13:36
andreiborza added a commit to thedanchez/sentry-javascript that referenced this pull request Oct 15, 2025
…etsentry#17664) ✅ This PR depends on getsentry#17625 and it should be reviewed only after that one is merged. This PR adds: 1. Streaming support for Google GenAI sdk instrumenting the following methods: 1. Models API Streaming - `models.generateContentStream()` - Stream content generation with real-time chunks 3. Chat API Streaming (chats.create) - `chat.sendMessageStream()` - Stream chat responses with conversation context 2. New tool calls attributes - GEN_AI_REQUEST_AVAILABLE_TOOLS_ATTRIBUTE - Captures available tools from requests - GEN_AI_RESPONSE_TOOL_CALLS_ATTRIBUTE - Captures function calls from responses --------- Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants