Skip to content

ref(core): Add more specific event mechanisms to openAiIntegration #17288

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Aug 1, 2025

Also added the sentry.origin attribute to the openAi spans since it was missing.
mechanism.type now follows the same pattern

ref #17212
ref #17252

@Lms24 Lms24 self-assigned this Aug 1, 2025
@Lms24 Lms24 requested review from RulaKhaled and andreiborza August 1, 2025 14:55
@Lms24 Lms24 mentioned this pull request Aug 1, 2025
4 tasks
cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: OpenAI Requests Missing Origin Property

Spans created for both streaming and non-streaming OpenAI requests are missing the top-level origin property. While the SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN attribute is correctly set, the startSpan options should also explicitly include origin: 'auto.ai.openai'.

packages/core/src/utils/openai/index.ts#L238-L242

name: `${operationName} ${model} stream-response`,
op: getSpanOperation(methodPath),
attributes: requestAttributes as Record<string, SpanAttributeValue>,
},
async (span: Span) => {

packages/core/src/utils/openai/index.ts#L274-L278

// Non-streaming responses
return startSpan(
{
name: `${operationName} ${model}`,
op: getSpanOperation(methodPath),

Fix in Cursor Fix in Web

Copy link
Contributor

github-actions bot commented Aug 1, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.76 kB - -
@sentry/browser - with treeshaking flags 22.35 kB - -
@sentry/browser (incl. Tracing) 39.43 kB - -
@sentry/browser (incl. Tracing, Replay) 77.52 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.39 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.22 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 94.35 kB - -
@sentry/browser (incl. Feedback) 40.45 kB - -
@sentry/browser (incl. sendFeedback) 28.45 kB - -
@sentry/browser (incl. FeedbackAsync) 33.34 kB - -
@sentry/react 25.5 kB - -
@sentry/react (incl. Tracing) 41.4 kB - -
@sentry/vue 28.2 kB - -
@sentry/vue (incl. Tracing) 41.23 kB - -
@sentry/svelte 23.79 kB - -
CDN Bundle 25.28 kB - -
CDN Bundle (incl. Tracing) 39.3 kB - -
CDN Bundle (incl. Tracing, Replay) 75.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 80.82 kB - -
CDN Bundle - uncompressed 73.86 kB - -
CDN Bundle (incl. Tracing) - uncompressed 116.35 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 230.56 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 243.37 kB - -
@sentry/nextjs (client) 43.46 kB - -
@sentry/sveltekit (client) 39.87 kB - -
@sentry/node-core 47.53 kB - -
@sentry/node 146.22 kB +0.03% +32 B 🔺
@sentry/node - without tracing 91.63 kB - -
@sentry/aws-serverless 103.08 kB - -

View base workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant