meta(changelog): Update changelog for 10.37.0#18984
Merged
andreiborza merged 33 commits intomasterfrom Jan 27, 2026
Merged
Conversation
[Gitflow] Merge master into develop
…#18906) **Changes** - This simplifies AI message truncation to always keep only the last message and truncate it if needed. Previously we dropped oldest messages one by one until we fit within the limit. - Set embeddings input as a separate attribute `gen_ai.embeddings.input` and do not truncate that. - Also added support for truncating plain string arrays. Not sure if we need that at the moment, since we no longer truncate embeddings, but shouldn't hurt. **Test Updates** - Updated all node integration and unit tests to work with the new logic. - Extended the node integration suite to always test the two main scenarios (keep the large message and then either truncate if the last message is large or leave it as is if it is small). - Removed the embeddings truncation tests and instead added a new embeddings scenario that checks that embeddings inputs are all kept (even if an array with multiple entries is passed). Closes #18916
This PR adds automatic instrumentation for global request and function
middleware in TanStack Start applications.
**Overview**
The sentryTanstackStart Vite plugin now automatically wraps
requestMiddleware and functionMiddleware arrays in `createStart()` with
Sentry instrumentation. This is done via a source code transformation
during the build that converts:
```
createStart({
requestMiddleware: [myMiddleware],
functionMiddleware: [anotherMiddleware],
});
```
into:
```
import { wrapMiddlewaresWithSentry } from '@sentry/tanstackstart-react';
createStart({
requestMiddleware: wrapMiddlewaresWithSentry({ myMiddleware }),
functionMiddleware: wrapMiddlewaresWithSentry({ anotherMiddleware }),
});
```
**Usage**
Auto-instrumentation is enabled by default. To explicitly disable it:
```
// vite.config.ts
import { sentryTanstackStart } from '@sentry/tanstackstart-react';
export default defineConfig({
plugins: [
sentryTanstackStart({
org: 'your-org',
project: 'your-project',
autoInstrumentMiddleware: false, // Disable auto-instrumentation
}),
],
});
```
This should give users flexibility in case things go wrong.
**Implementation Details**
- Uses a regex-based approach to transform source files containing
`createStart()`
- Skips transformation if the user has already manually wrapped
middlewares with `wrapMiddlewaresWithSentry`
- Only handles simple identifier arrays (e.g., [foo, bar]), not complex
expressions
**Testing**
- Updated E2E tests to use auto-instrumentation for global middleware
- Updated unit tests for the `sentryTanstackStart` plugin
- Added unit tests for `autoInstrumentMiddleware`
**Follow-ups**
Future PRs will add support for non-global request/function middleware.
This PR focuses on global middleware to make it a bit easier to review.
I also want to give users a bit more control by allowing them to disable
auto-instrumentation on a file-level, but this doesn't make sense yet
since the current implementation only patches a single file anyways.
Closes #18845
chore(e2e): Change dynamic react-router server build import to static import
Before submitting a pull request, please take a look at our [Contributing](https://github.com/getsentry/sentry-javascript/blob/master/CONTRIBUTING.md) guidelines and verify: - [ ] ~If you've added code that should be tested, please add tests.~ - [x] Ensure your code lints and the test suite passes (`yarn lint`) & (`yarn test`). - [x] Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked. Closes #17181 --------- Co-authored-by: JPeer264 <jan.peer@sentry.io>
This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. See #18900 Co-authored-by: JPeer264 <10677263+JPeer264@users.noreply.github.com>
- adds more framework internals to the default ignore list (these will never emit sourcemaps and we just waste time processing these files) - updates ignore list to use glob patterns as this is the only way the cli properly picks them up closes #18872
This new reason can be used when the client drops telemetry items due to failing internal validation (e.g. dropping replays that contain invalid session times) ref #18316 depends on getsentry/snuba#7654 closes https://linear.app/getsentry/issue/FE-690/update-js-sdk-to-support-client-discard-invalid
#18953) We have many e2e test apps and it can be cumbersome to type in which exact app you want to run. This PR adds a Makefile that uses `fzf` to give a better experience: https://github.com/user-attachments/assets/8fe472a6-34ac-4311-81aa-e8d384e51760 Note: Requires having `fzf` installed via `brew install fzf` or other package managers.
Adds the missing `platform` in the envelope item header. Related: getsentry/sentry-docs#16135 Closes https://linear.app/getsentry/issue/JS-1540/ui-profiling-add-platform-to-profile-chunk-item-header (internal Linear)
) Stumbled upon this while working on something else. The source map related code was always executed on the package manager's `install` command and as `nuxi prepare` runs on `postinstall`. This step is only important for generating the types, so we can skip all source map related things here so this only runs during the actual build. I also changed the console log a bit so it's more clear what we are doing. Nuxt docs: https://nuxt.com/docs/4.x/api/commands/prepare Closes #18937 (added automatically)
#18945) While working on the `gen_ai.request.messages` rename I noticed that we hardcode all the attributes in our ai integration tests (both node and cloudflare), meaning that we currently need to change each individual test just to rename one attribute name. This PR refactors this to use the attributes from our `gen-ai-attributes.ts`. I also added some missing entries for attributes that we currently hardcode in the integrations. Closes #18951 (added automatically)
The nature of running e2e tests in our repo is particular: When making changes in an SDK, we need to rebuild that SDK and create its tarball, only then can we run the e2e test application. Agents lack this context and will often make changes, rebuild the SDK but not publish a tarball for example. This skill can be invoked via `/e2e <test-application-name>`, e.g. `/e2e nuxt-3` and it will detect and perform SDK rebuilds before running the e2e tests.
This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. See #18796 Co-authored-by: chargome <20254395+chargome@users.noreply.github.com>
) Closes #18960 (added automatically)
… conversations (#18909) Introduces a new `Sentry.setConversationId()` API to track multi turn AI conversations across API calls. > We want to leverage each AI frameworks built-in functionalities wherever possible. OpenAIs conversation_id, sessions, etc to create the gen_ai.conversation.id attribute. > However if the framework does not provide such a mechanism (such as Google GenAI or Anthropic) we shall provide a common function: Sentry.setConversationId(...) or sentry_sdk.set_conversation_id(), which adds the conversation ID to the Scope in a similar way as Sentry.setUser() and sentry_sdk.set_user() do. When provided in such a way it will override any automatically detected value. _Why not just add this as an attribute?_ it should only appear as a span attribute, not propagate to logs and metrics. This keeps AI conversation context isolated to spans where it's semantically relevant. - Related to: https://linear.app/getsentry/issue/TET-1736/python-sdk-add-gen-aiconversationid-to-the-integrations-where-it-is#comment-77bf901d - Closes: https://linear.app/getsentry/issue/JS-1515/implement-a-new-sentrysetconversationid-api
#18925) AI integrations should follow OTel spec and report the gen_ai.operation.name with the values listed in sentry conventions if applies getsentry/sentry-conventions#225, this PR renames gen_ai.operation so that if one of values applies, then that value MUST be used. Closes https://linear.app/getsentry/issue/JS-1527/report-well-known-values-in-gen-aioperationname-attribute
- Bump @opentelemetry/context-async-hooks from 2.4.0 to 2.5.0 - Bump @opentelemetry/core from 2.4.0 to 2.5.0 - Bump @opentelemetry/instrumentation from 0.210.0 to 0.211.0 - Bump @opentelemetry/instrumentation-amqplib from 0.57.0 to 0.58.0 - Bump @opentelemetry/instrumentation-aws-sdk from 0.65.0 to 0.66.0 - Bump @opentelemetry/instrumentation-connect from 0.53.0 to 0.54.0 - Bump @opentelemetry/instrumentation-dataloader from 0.27.0 to 0.28.0 - Bump @opentelemetry/instrumentation-express from 0.58.0 to 0.59.0 - Bump @opentelemetry/instrumentation-fs from 0.29.0 to 0.30.0 - Bump @opentelemetry/instrumentation-generic-pool from 0.53.0 to 0.54.0 - Bump @opentelemetry/instrumentation-graphql from 0.57.0 to 0.58.0 - Bump @opentelemetry/instrumentation-hapi from 0.56.0 to 0.57.0 - Bump @opentelemetry/instrumentation-http from 0.210.0 to 0.211.0 - Bump @opentelemetry/instrumentation-ioredis from 0.58.0 to 0.59.0 - Bump @opentelemetry/instrumentation-kafkajs from 0.19.0 to 0.20.0 - Bump @opentelemetry/instrumentation-knex from 0.54.0 to 0.55.0 - Bump @opentelemetry/instrumentation-koa from 0.58.0 to 0.59.0 - Bump @opentelemetry/instrumentation-lru-memoizer from 0.54.0 to 0.55.0 - Bump @opentelemetry/instrumentation-mongodb from 0.63.0 to 0.64.0 - Bump @opentelemetry/instrumentation-mongoose from 0.56.0 to 0.57.0 - Bump @opentelemetry/instrumentation-mysql from 0.56.0 to 0.57.0 - Bump @opentelemetry/instrumentation-mysql2 from 0.56.0 to 0.57.0 - Bump @opentelemetry/instrumentation-nestjs-core from 0.56.0 to 0.57.0 - Bump @opentelemetry/instrumentation-pg from 0.62.0 to 0.63.0 - Bump @opentelemetry/instrumentation-redis from 0.58.0 to 0.59.0 - Bump @opentelemetry/instrumentation-tedious from 0.29.0 to 0.30.0 - Bump @opentelemetry/instrumentation-undici from 0.20.0 to 0.21.0 - Bump @opentelemetry/resources from 2.4.0 to 2.5.0 - Bump @opentelemetry/sdk-trace-base from 2.4.0 to 2.5.0 - Bump @opentelemetry/semantic-conventions from 1.37.0 to 1.39.0 Closes #18958 (added automatically) --------- Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
#18944) - rename `gen_ai.request.messages` to `gen_ai.input.messages` - also rename `gen_ai.request.messages.original_length` to `gen_ai.input.messages.original_length` (not sure if we get rid of this attribute in favor of `sentry.sdk_meta.gen_ai.input.messages.original_length` but for now renaming to this so we stay consistent since I will do the other rename in a separate PR) - fix some more test constants I missed with the last PR Closes #18919
closes #18946 closes [JS-1536](https://linear.app/getsentry/issue/JS-1536/contradicting-warnings-between-sentryastro-and-sentry-vite-plugin) This is a follow up PR for #17396 I also changed the name to `doNotUseTheseOptions` to kinda prevent this in the future
…jection (#18973) When a stream aborts in Vercel V6 an `AbortError` is thrown. Adding this to the default ignored errors in the `onUnhandledRejectionIntegration` integration. We already did this previously, but the exception name thrown by Vercel changed from V5 to V6. More context can be found in [this](#17675) issue. Closes #17675
The [#17830](#17830) fixes the error explained in #17781 only for the sentry.client.config.ts but the error still exists for the sentry.server.config.ts. With this PR we add the sentry.config.server.ts to the auto generated tsconfig by extending the types via the [prepare:types hook](https://nuxt.com/docs/4.x/guide/going-further/modules#adding-type-declarations). This allows useRuntimeConfig to be properly typed in the root sentry.server.config.ts, or where ever the client file is found. Not sure how this could be tested tho, since it is purely types. Co-authored-by: Federico Torresan <federico.torresan@gruppoadorea.it>
…ad (#18881) Following up on #18155 and #18346 Fixes an issue where pageload transactions have incorrect names (URL-based or wildcard-based) when lazy routes load after the span ends due to idle timeout. This occurs when using patchRoutesOnNavigation for lazy route loading. The idle timeout can fire before lazy routes finish loading, causing the span to end with a wildcard like `/slow-fetch/*` instead of the parameterized `/slow-fetch/:id`. The root cause was that the active span was captured after router creation, making it inaccessible when `patchRoutesOnNavigation` was called later (span already ended). Also, `patchSpanEnd` was taking a snapshot of `allRoutes`, so lazy routes added later wouldn't be visible. This fix: - Captures the active span before router creation and passes it to `wrapPatchRoutesOnNavigation` - Adds a deferred promise mechanism that blocks span finalization until `patchRoutesOnNavigation` completes - Uses the global `allRoutes` Set directly instead of a snapshot - Handles pageload spans in `patchRoutesOnNavigation` (was only handling navigation before)
…18580) Adds support for React Router's `unstable_instrumentations` API for automatic performance monitoring. Resolves: #18127 Resolves: #18121 Ref: remix-run/react-router#13749 Ref: remix-run/react-router#14412 React Router 7.9.5 introduced the [`unstable_instrumentations` API](https://reactrouter.com/how-to/instrumentation), which provides hooks for instrumenting request handlers, loaders, actions, middleware, and lazy routes. This enables automatic span creation without requiring manual wrapper functions. ### Server-side Added `createSentryServerInstrumentation()`: - `handler.request` - Creates root HTTP server span with parameterized route names - `route.loader` - Automatic loader span creation - `route.action` - Automatic action span creation - `route.middleware` - Automatic middleware span creation - `route.lazy` - Lazy route loading spans ```typescript // entry.server.tsx import * as Sentry from '@sentry/react-router'; export default Sentry.createSentryHandleRequest({ /* ... */ }); export const handleError = Sentry.createSentryHandleError(); export const unstable_instrumentations = [Sentry.createSentryServerInstrumentation()]; ``` ### Client-side Added client instrumentation via `reactRouterTracingIntegration({ useInstrumentationAPI: true })`: - `router.navigate` - Navigation transaction creation - `router.fetch` - Fetcher span creation - `route.loader/action/middleware/lazy` - Client-side route handler spans ```typescript // entry.client.tsx const tracing = Sentry.reactRouterTracingIntegration({ useInstrumentationAPI: true }); Sentry.init({ integrations: [tracing], }); <HydratedRouter unstable_instrumentations={[tracing.clientInstrumentation]} /> ``` ### Backward compatibility When the instrumentation API is used: - `wrapServerLoader` and `wrapServerAction` skip creating spans and emit a warning in debug mode - Legacy navigation patching in `instrumentHydratedRouter` checks if instrumentation API handled it - Server-side OTEL instrumentation for loaders/actions is skipped ### Also: - Created `serverGlobals.ts` to isolate flag handling (avoids pulling OpenTelemetry deps in Cloudflare builds) - Updated `wrapSentryHandleRequest` to explicitly set parameterized transaction names (improves Hydrogen parameterization) - Added E2E test application `react-router-7-framework-instrumentation` ### Notes - Client-side limitation: As of React Router 7.x, HydratedRouter does not invoke client instrumentation hooks in Framework Mode. Client-side navigation is handled by existing instrumentHydratedRouter(). The client instrumentation is prepared for when React Router adds support. See remix-run/react-router#13749. - Lazy routes limitation: In Framework Mode, `route.lazy` hooks are not triggered because the bundler handles code-splitting. _Needs docs PR_ --------- Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
This PR sets up E2E tests for Next.js 16 running on Cloudflare Workers using OpenNext. Some tests yield different transaction names and span attributes, I will review each of the skipped tests and review the differences and if we should either consolidate the edge runtime behavior with the node runtime behavior. ### Known Limitations Those are the test failures that required skipping. - Middleware `proxy` filename not being picked up by opennext, yet `middleware` works on Next 16 😕 - HTTP request headers not extracted as span attributes - Metrics not emitting on Cloudflare Workers - Middleware `transaction_info.source` is `'url'` instead of `'route'` - Server component spans have different names (e.g., `'resolve segment modules'` instead of specific component names) - Missing `http.response.status_code` / `http.status_code` attributes I plan to follow up with another PR to address these, but the higher priority is making sure the SDK doesn't crash and works to some degree on CF worker apps. Closes #18929 (added automatically)
Bumps versions of the bundler plugins to include the latest fixes related to debug ID injection. Version 4.6.2 already included the [fix for preventing double-injected debug IDs](getsentry/sentry-javascript-bundler-plugins#827) (closes #18519) but version 4.7.0 brings some further improvements for debug ID injection and also adds [improvements for the build plugin manager](getsentry/sentry-javascript-bundler-plugins#836) (which will be used in Nuxt SDK in the future).
This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. See #18971 Co-authored-by: s1gr1d <32902192+s1gr1d@users.noreply.github.com>
So far we put all the messages including the system prompt on gen_ai.request.messages. Instead, the system prompt should be pulled out and set as a separate attribute called gen_ai.system_instructions. For now we will search for the first system message and use that. Closes #18917
`yarn prisma` is better to use since it uses the correct `node_modules` path. Without it it may break at some point since the global package could be different at some point. Closes #18976 (added automatically)
closes #18868 closes [JS-1498](https://linear.app/getsentry/issue/JS-1498/allow-customization-of-level-mapping-in-createsentrywinstontransport) ATM it is not possible to map custom levels to OpenTelemetry levels. The option `customLevelMap` has been added to make this possible. Which means that custom levels would have never been send to Sentry, as they were not mapped correctly. Now when there are custom levels it can be used like this: ```js const customLevels = { levels: { customCritical: 0, customNotice: 2, }, }; const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport, { customLevelMap: { customCritical: 'fatal', customNotice: 'info', }, }); const mappedLogger = winston.createLogger({ levels: customLevels.levels, level: 'customNotice', // this needs to be added due to winstonjs/winston#1491 transports: [new SentryWinstonTransport()], }); ``` ### Merge checklist - [ ] Sentry Docs update issue has been created
s1gr1d
reviewed
Jan 27, 2026
CHANGELOG.md
Outdated
|
|
||
| ## 10.37.0 | ||
|
|
||
| Work in this release was contributed by @sebws, @harshit078, and @fedetorre. Thank you for your contributions! |
Member
There was a problem hiding this comment.
Usually, we put this comment at the end of the release notes.
Member
Author
There was a problem hiding this comment.
Sorry about this PR, I should have known better...
Thanks for catching!
CHANGELOG.md
Outdated
| This is particularly useful for tracking multiple AI API calls that are part of the same conversation, allowing you to analyze entire conversation flows in Sentry. | ||
| The conversation ID is stored on the isolation scope and automatically applied to spans via the new `conversationIdIntegration`. | ||
|
|
||
| ### Important Changes |
Member
There was a problem hiding this comment.
This heading should be at the top
5028220 to
429ac16
Compare
Contributor
size-limit report 📦
|
Contributor
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.
|
s1gr1d
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.