meta(changelog): Update changelog for 10.51.0#20599
Conversation
…github.com:getsentry/sentry-javascript into lazarnikolov/js-2140-tanstack-start-tunnel-adapter
Made-with: Cursor
Align sentryTanstackStart tests with TunnelRouteOptions.path and annotate spy case with SentryTanstackStartOptions so options match the public API. Made-with: Cursor
Made-with: Cursor
…r quote styles Made-with: Cursor
[Gitflow] Merge master into develop
After looking a bit at what the slowest browser-integration-tests are, I found an easy-to-fix pattern in our tests - we had _a lot_ of tests there that set some arbitrary `idleTimeout` to the `browserIntegrationTest`. This massively made these tests slower as it takes much longer to flush any pageload span. Many test runtimes reduced from 10-20s to 1-5s due to this change. A few places remain where this seems to be necessary, but there are way fewer now. FYI 1000ms is the default, we also had some defining this for some reason, I also removed those to be more consistent.
Use optional chaining on `.length` to collapse the redundant existence + length-guard ternary into a single expression. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This PR just isolates the mundane changes needed for a new SDK to keep the next stacked PRs clean, it adds the Nitro SDK to the monorepo. This PR is a base of a stack, the stacked PRs will be merged into it. I thought this will be easier to review. --- **This PR is part of a stack:** - #20358 - #19224 👈 - #19225 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers the `{ path, allowedDsns }` shape of `tunnelRoute` end-to-end
alongside the existing dynamic/static/custom variants, exercising the
build-time serialization of `allowedDsns` into the generated virtual
route module. Also refactors the `tunnelRoute` resolution in
`vite.config.ts` from a nested ternary to a switch for readability.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The tunnel variants run independently through sentryTest.variants in CI, so the chained `test:assert` was redundant and slow to run locally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…k-start-tunnel-adapter Tunnel route helper + Dynamic tunnel route generator for TanStack Start React
If there is only one `bin` script (which is the case for Remix and Profiling), it's possible to just run `npx @sentry/remix` and it will run this one script. But to make it more clear what's going to happen, we're introducing an argument `--upload-sourcemaps`. **Remix:** The script usage changes so we can rename the `bin` script in the next major version. **Profiling:** The script is going to be deleted and deprecation notices are added. Related to: #20422
Add skill for writing tests. Created and evaluated with https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md Used sources for "how to write good tests": - https://vitest.dev/guide/learn/writing-tests-with-ai.html - https://github.com/andredesousa/javascript-unit-testing-best-practices - my knowledge from university - LOL
…#20556) We accidentally added a `node` dependency to an export from `opentelemetry` package, leading to problems for users using this in a browser environment. This PR adds conditional exports to the opentelemetry package, where for `browser` targets we have stubs for the node-only thing. This should generally work the same as before, but stop failing builds in browser envs. I had to adjust browser integration tests for this a bit, as they did some unnecessary aliasing which prevented webpack from using normal conditional exports. We are simply doing less now and doing regular dependency resolution which should work as expected (hopefully).
This updates the CODEOWNERS config to accomodate our new groups.
This PR adds instrumentation for LangGraph's `createReactAgent` API. ## createReactAgent wrapping - Extracts agent name, LLM model, and tools from params - Wraps compiled graph's `invoke()` with `invoke_agent` span - Wraps tool `invoke()` with `execute_tool` spans (name, type, description, arguments, result) - Injects LangChain callback handler + `lc_agent_name` + `__sentry_langgraph__` metadata at invoke level for chat span creation and agent name propagation to all child spans - Suppresses `StateGraph.compile` instrumentation inside `createReactAgent` to avoid duplicate spans ## LangChain callback handler improvements - Reads `gen_ai.agent.name` from `metadata.lc_agent_name` (convention from newer LangGraph `createAgent`, adopted for our supported versions) - Suppresses chain and tool callback spans inside agent context (based on `metadata.__sentry_langgraph__` presence) to avoid duplicates with our direct instrumentation - Extracts tool definitions from `extraParams` in `handleChatModelStart` and sets `gen_ai.request.available_tools` on chat spans - Uses `runName` for tool name in `handleToolStart` (set by LangChain's `StructuredTool.call()`) — fixes `unknown_tool` issue - Adds `gen_ai.operation.name` to tool spans - Extracts `.content` from ToolMessage objects in `handleToolEnd` instead of serializing the full wrapper - `addToolCallsAttributes` now prefers `message.tool_calls` (LangChain's normalized format) over scanning `message.content` for Anthropic-style `tool_use` items, fixing duplicate tool calls on Anthropic chat spans. Falls back to `message.content` scanning for older LangChain versions. ## OTel module patching - Patches `@langchain/langgraph/prebuilt` for `createReactAgent` (ESM + CJS file patches for `dist/prebuilt/index.cjs`) ## Exports - `instrumentCreateReactAgent` from core, browser, cloudflare Closes: #19372
…SN` (#20528) If this is set (which should generally be the case when using the layer), we want to only allow this DSN to be forwarded. If not set, it does not validate but warn that this is not validated. --------- Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com>
Saw this flake once or twice, just increasing timeout for cron tests to allow for slow runner startup etc.
…ame (#20589) Today, we got a bunch of flaky CI issues for e.g. failing cache or playwright installation. While these are also kind of flakes, the issues are not super actionable and it gets a bit noisy. I'd opt to not create an issue if we cannot identify a concrete test that is flaking. We miss out on some things being auto-reported here but that's also OK I'd say. Closes #20319 Closes #20557 Closes #20493 Closes #20492 Closes #20469 Closes #20470
…handlers (#20554) Previously, Hono `.route()` was patched by checking for an `'ALL'` handler (as those are used as middleware) to detect middleware in Hono sub-apps. But this incorrectly treated `.all()` final handlers as middleware. This broke error capture for `.all()` error routes (the wrapped handler caught and marked the error, preventing responseHandler from capturing it). Now we use an arity heuristic (arity = number of params): middleware accepts `(context, next)`, while route handlers accept only `(context)`. Also added more middleware-related E2E test scenarios and route-patterns tests. Basically adding test scenarios from the Node integration test to the E2E test: https://github.com/getsentry/sentry-javascript/blob/5d0d14531511fcd703438e072723ef98cd700ea3/dev-packages/node-integration-tests/suites/tracing/hono/test.ts Part of Project: #15260 Builds onto: #20449
Closes #20553 The clanker identified this as possible problem here: > docker compose up --wait waits on the container healthcheck (pg_isready inside the DB). On busy CI, localhost:5444 can still refuse connections briefly afterward, so the scenario could hit Postgres before it was reachable from the host and fail or behave inconsistently → flaky CJS (and the same class of failure for the other scenarios).
Found some other places in browser-integration-tests that could theoretically be flaky due to when we start listening for events vs. when we navigate.
| } | ||
|
|
||
| sentryTest('should capture a `connection.rtt` metric.', async ({ getLocalTestUrl, page }) => { | ||
| sentryTest('should capture a `connection.rtt` metric. xxx', async ({ getLocalTestUrl, page }) => { |
There was a problem hiding this comment.
Debug text "xxx" left in test name
Low Severity
The test name 'should capture a \connection.rtt` metric. xxx'contains leftover debug textxxx` that appears to have been accidentally committed. This pollutes test output and makes the test suite look unprofessional.
Reviewed by Cursor Bugbot for commit a33bf99. Configure here.
a33bf99 to
6cfa338
Compare
6cfa338 to
3be99a9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3be99a9. Configure here.
|
|
||
| const middlewareSpans = spans.sort((a, b) => (a.start_timestamp ?? 0) - (b.start_timestamp ?? 0)); | ||
|
|
||
| expect(middlewareSpans).toHaveLength(2); |
There was a problem hiding this comment.
Missing span filter in refactored middleware test
Medium Severity
The refactored "multiple middleware" test lost the .filter() call that previously selected only middleware spans (span.op === 'middleware.hono' && span.origin === 'auto.middleware.hono'). Now middlewareSpans contains all transaction spans, and the toHaveLength(2) assertion checks the total span count rather than the middleware span count. This makes the test fragile and could cause false failures on runtimes (like Node/OTel) that produce additional non-middleware spans.
Reviewed by Cursor Bugbot for commit 3be99a9. Configure here.
size-limit report 📦
|
|
|
||
| ### Other Changes | ||
|
|
||
| - deps(minimatch): Upgrade patch version to use new `brace-expansion` peer-dep ([#20198](https://github.com/getsentry/sentry-javascript/pull/20198)) |


No description provided.