Skip to content

feat(browser): Add previous_trace span links - #15569

Merged
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links
Mar 21, 2025
Merged

feat(browser): Add previous_trace span links#15569
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links

Conversation

@Lms24

@Lms24Lms24 commented Mar 4, 2025

Copy link
Copy Markdown
Member

This PR adds logic to set the previous_trace span link on root spans (via browserTracingIntegration).

Some notes:

  • added linkPreviousTrace integration option to control the trace linking behaviour:
    • in-memory - default - previous trace data is linked and stored in memory
    • session-storage - previous trace data is linked and stored in session storage
    • off - no previous trace data is stored or linked
  • we can't yet sample on the previous trace in tracesSampler but this I'll tackle via Add option to sample linked traces consistently #15754
  • everything is implemented within browserTracingIntegration, meaning there's no bundle size hit for error-only users or users who only send manual spans (the latter is a tradeoff but I think it's a fair one)
  • added unit and integration tests for a bunch of scenarios

Happy to bike shed on the options naming :D

closes#14992

UPDATE: I rewrote the public API options from having two options (enablePreviousTrace and persistPreviousTrace) to only one which controls both aspects.

@github-actions

github-actionsBot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.28 KB--
@sentry/browser - with treeshaking flags23.09 KB--
@sentry/browser (incl. Tracing)36.6 KB+0.78%+287 B 🔺
@sentry/browser (incl. Tracing, Replay)73.79 KB+0.41%+305 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags67.14 KB+0.34%+231 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)78.42 KB+0.39%+307 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)90.99 KB+0.37%+338 B 🔺
@sentry/browser (incl. Feedback)40.41 KB--
@sentry/browser (incl. sendFeedback)27.91 KB--
@sentry/browser (incl. FeedbackAsync)32.71 KB--
@sentry/react25.07 KB--
@sentry/react (incl. Tracing)38.53 KB+0.76%+296 B 🔺
@sentry/vue27.5 KB--
@sentry/vue (incl. Tracing)38.3 KB+0.74%+288 B 🔺
@sentry/svelte23.31 KB--
CDN Bundle24.5 KB--
CDN Bundle (incl. Tracing)36.61 KB+0.67%+248 B 🔺
CDN Bundle (incl. Tracing, Replay)71.62 KB+0.33%+235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)76.82 KB+0.31%+236 B 🔺
CDN Bundle - uncompressed71.63 KB--
CDN Bundle (incl. Tracing) - uncompressed108.66 KB+0.62%+684 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed219.92 KB+0.31%+684 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed232.49 KB+0.29%+684 B 🔺
@sentry/nextjs (client)39.81 KB+0.73%+295 B 🔺
@sentry/sveltekit (client)37.03 KB+0.79%+294 B 🔺
@sentry/node142.63 KB--
@sentry/node - without tracing96.01 KB--
@sentry/aws-serverless120.38 KB--

View base workflow run

@Lms24Lms24 self-assigned this Mar 4, 2025
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 66ec822 to 45bc790CompareMarch 19, 2025 15:40
@Lms24
Lms24 marked this pull request as ready for review March 20, 2025 11:51
@Lms24
Lms24 requested review from mydea and s1gr1dMarch 20, 2025 11:51
Comment on lines +396 to +400
previousTraceInfo = addPreviousTraceSpanLink(previousTraceInfo, span);

if (persistPreviousTrace) {
storePreviousTraceInSessionStorage(previousTraceInfo);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think all this code around the previous trace can be put in here. Then there is also no need to mutate the variable or store undefined in a variable if persisting is turned off.

Suggested change
previousTraceInfo=addPreviousTraceSpanLink(previousTraceInfo,span);
if(persistPreviousTrace){
storePreviousTraceInSessionStorage(previousTraceInfo);
}
if(persistPreviousTrace){
constupdatedPreviousTraceInfo=addPreviousTraceSpanLink(
getPreviousTraceFromSessionStorage(),span
)
storePreviousTraceInSessionStorage(updatedPreviousTraceInfo);
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Happy to rewrite this but I still need to call addPreviousTraceSpanLink if persistPreviousTrace is false (as by default). Let me take another look

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I rewrote this a bit based on your suggestion as well as on unifying the two options. b44e790

Comment threadpackages/browser/src/tracing/previousTrace.ts
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 0550ac6 to 6c42afdCompareMarch 20, 2025 14:25
@Lms24
Lms24 requested a review from s1gr1dMarch 21, 2025 09:56

@s1gr1ds1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Such nice API 🥇

@Lms24
Lms24 merged commit 1a4fa0c into developMar 21, 2025
@Lms24
Lms24 deleted the lms/feat-previous-trace-links branch March 21, 2025 10:21
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 17, 2025
![snyk-io[bot]](https://badgen.net/badge/icon/snyk-io%5Bbot%5D/green?label=)
![Contributor](https://badgen.net/badge/icon/Contributor/000000?label=)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.7.0 to
9.9.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **24 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.8.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.8.0">2025-03-21</a></br><ul>
<li>feat(node): Implement new continuous profiling API spec (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15635"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15635/hovercard">#15635</a>)</li>
<li>feat(profiling): Add platform to chunk envelope (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15758"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15758/hovercard">#15758</a>)</li>
<li>feat(react): Export captureReactException method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15746"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15746/hovercard">#15746</a>)</li>
<li>fix(node): Check for <code>res.end</code> before passing to Proxy
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15776"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15776/hovercard">#15776</a>)</li>
<li>perf(core): Add short-circuits to <code>eventFilters</code>
integration (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15752"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15752/hovercard">#15752</a>)</li>
<li>perf(node): Short circuit flushing on Vercel only for Vercel (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15734"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15734/hovercard">#15734</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.29 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.11 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.51 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.15 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.43 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.73 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.1 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.26 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.53 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.04 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.33 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.52 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.38 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.41 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.61 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.68 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.06 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.32 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.88 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.56 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.76 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.65 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.04 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.41 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.7.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.7.0">2025-03-20</a></br><ul>
<li>feat(core): Add <code>captureLog</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15717"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15717/hovercard">#15717</a>)</li>
<li>feat(remix/cloudflare): Export <code>sentryHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15726"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15726/hovercard">#15726</a>)</li>
<li>fix(node): Always flush on Vercel before Lambda freeze (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15602"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15602/hovercard">#15602</a>)</li>
<li>fix(node): Ensure incoming traces are propagated without
HttpInstrumentation (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15732"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15732/hovercard">#15732</a>)</li>
<li>fix(node): Use <code>fatal</code> level for unhandled rejections in
<code>strict</code> mode (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15720"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15720/hovercard">#15720</a>)</li>
<li>fix(nuxt): Delete Nuxt server template injection (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15749"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15749/hovercard">#15749</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.28 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.09 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.33 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.5 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.93 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.13 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.69 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.7 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.08 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.23 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.02 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.3 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.49 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.37 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.57 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.56 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>107.94 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.2 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.77 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.52 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.73 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.62 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.01 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.37 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJjNzI0M2IxOS0yMmVlLTQ5NWItYWJhMS02YjJlOGVhY2FlYjYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImM3MjQzYjE5LTIyZWUtNDk1Yi1hYmExLTZiMmU4ZWFjYWViNiJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.7.0","to":"9.9.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","prPublicId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-03-24T13:46:37.750Z"},"vulns":[]}'
## Podsumowanie od Sourcery
Aktualizacja @sentry/browser z wersji 9.7.0 do 9.9.0
Ulepszenia:
- Dodano wsparcie dla instrumentacji po stronie klienta Next.js
- Wprowadzono możliwość łączenia poprzednich śladów (traces)
- Dodano metody loggera dla nadchodzącego produktu do logowania Sentry
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.7.0 to 9.9.0
Enhancements:
- Added support for Next.js client-side instrumentation
- Introduced ability to link previous traces
- Added logger methods for upcoming Sentry logging product
</details>
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 18, 2025
![reisene](https://badgen.net/badge/icon/reisene/green?label=) [<img
width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
<!--- SUMMARY_MARKER --->
## Sweep Summary <sub><a href="https://app.sweep.dev"><img
src="https://raw.githubusercontent.com/sweepai/sweep/main/.assets/sweep-square.png"
width="25" alt="Sweep"></a></sub>
Adds user registration functionality with email uniqueness validation
and password encoding to the HulajDusza service.
- Created `UserRegistrationDto` with validation annotations for email,
password, and name fields.
- Added `isEmailInUse` method to `UserService` to check if an email is
already registered.
- Implemented `registerUser` method in `UserServiceImpl` that creates a
new user with encoded password.
- Added `/api/users/register` endpoint in `UserController` that handles
user registration requests and returns appropriate HTTP responses.
---
[Ask Sweep AI questions about this PR](https://app.sweep.dev)
<!--- SUMMARY_MARKER --->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.9.0 to
9.10.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **22 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.10.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.10.0">2025-03-27</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat: Add support for logs</strong></p>
<ul>
<li>feat(node): Add logging public APIs to Node SDKs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15764"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15764/hovercard">#15764</a>)</li>
<li>feat(core): Add support for <code>beforeSendLog</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15814"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15814/hovercard">#15814</a>)</li>
<li>feat(core): Add support for parameterizing logs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15812"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15812/hovercard">#15812</a>)</li>
<li>fix: Remove critical log severity level (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15824"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15824/hovercard">#15824</a>)</li>
</ul>
<p>All JavaScript SDKs other than <code>@ sentry/cloudflare</code> and
<code>@ sentry/deno</code> now support sending logs via dedicated
methods as part of Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>.</p>
<p>Logging is gated by an experimental option,
<code>_experiments.enableLogs</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'PUBLIC_DSN',
// `enableLogs` must be set to true to use the logging features
_experiments: { enableLogs: true },
});
const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
trace('Starting database connection', { database: 'users' });
debug('Cache miss for user', { userId: 123 });
error('Failed to process payment', { orderId: 'order_123', amount: 99.99
});
fatal('Database connection pool exhausted', { database: 'users',
activeConnections: 100 });
// Structured logging via the `fmt` helper function. When you use `fmt`,
the string template and parameters are sent separately so they can be
queried independently in Sentry.
info(fmt(`Updated profile for user ${userId}`));
warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests:
${requests}, Limit: ${limit}`));"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'PUBLIC_DSN'</span><span class="pl-kos">,</span>
<span class="pl-c">// `enableLogs` must be set to true to use the
logging features</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> trace<span
class="pl-kos">,</span> debug<span class="pl-kos">,</span> info<span
class="pl-kos">,</span> warn<span class="pl-kos">,</span> error<span
class="pl-kos">,</span> fatal<span class="pl-kos">,</span> fmt <span
class="pl-kos">}</span> <span class="pl-c1">=</span> <span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">;</span>
<span class="pl-en">trace</span><span class="pl-kos">(</span><span
class="pl-s">'Starting database connection'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-en">debug</span><span class="pl-kos">(</span><span
class="pl-s">'Cache miss for user'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">userId</span>: <span
class="pl-c1">123</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">error</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to process payment'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">orderId</span>: <span class="pl-s">'order_123'</span><span
class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span
class="pl-c1">99.99</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">fatal</span><span class="pl-kos">(</span><span
class="pl-s">'Database connection pool exhausted'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span><span
class="pl-kos">,</span> <span class="pl-c1">activeConnections</span>:
<span class="pl-c1">100</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Structured logging via the `fmt` helper function.
When you use `fmt`, the string template and parameters are sent
separately so they can be queried independently in Sentry.</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Updated profile for user <span class="pl-s1"><span
class="pl-kos">${</span><span class="pl-s1">userId</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Rate limit approaching for endpoint <span
class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">endpoint</span><span class="pl-kos">}</span></span>.
Requests: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">requests</span><span class="pl-kos">}</span></span>,
Limit: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">limit</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p>With server-side SDKs like <code>@ sentry/node</code>, <code>@
sentry/bun</code> or server-side of <code>@ sentry/nextjs</code> or
<code>@ sentry/sveltekit</code>, you can do structured logging without
needing the <code>fmt</code> helper function.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const { info, warn }
= Sentry.logger;
info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404
});"><pre><span class="pl-k">const</span> <span class="pl-kos">{</span>
info<span class="pl-kos">,</span> warn <span class="pl-kos">}</span>
<span class="pl-c1">=</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-c1">logger</span><span
class="pl-kos">;</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'User %s logged in successfully'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to load user %s data'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">errorCode</span>: <span class="pl-c1">404</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>To filter logs, or update them before they are sent to Sentry, you
can use the <code>_experiments.beforeSendLog</code> option.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>diagnoseSdkConnectivity()</code>
function to programmatically detect possible connectivity issues (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15821"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15821/hovercard">#15821</a>)</strong></p>
<p>The <code>diagnoseSdkConnectivity()</code> function can be used to
programmatically detect possible connectivity issues with the Sentry
SDK.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const result = await
Sentry.diagnoseSdkConnectivity();"><pre><span class="pl-k">const</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span
class="pl-k">await</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span
class="pl-en">diagnoseSdkConnectivity</span><span
class="pl-kos">(</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>The result will be an object with the following properties:</p>
<ul>
<li><code>"no-client-active"</code>: There was no active client when the
function was called. This possibly means that the SDK was not
initialized yet.</li>
<li><code>"sentry-unreachable"</code>: The Sentry SaaS servers were not
reachable. This likely means that there is an ad blocker active on the
page or that there are other connection issues.</li>
<li><code>undefined</code>: The SDK is working as expected.</li>
</ul>
</li>
<li>
<p><strong>SDK Tracing Performance Improvements for Node
SDKs</strong></p>
<ul>
<li>feat: Stop using <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15796"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15796/hovercard">#15796</a>)</li>
<li>feat(node): Only add span listeners for instrumentation when used
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15802"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15802/hovercard">#15802</a>)</li>
<li>ref: Avoid <code>dropUndefinedKeys</code> for
<code>spanToJSON</code> calls (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15792"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15792/hovercard">#15792</a>)</li>
<li>ref: Avoid using <code>SentryError</code> for PromiseBuffer control
flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15822"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15822/hovercard">#15822</a>)</li>
<li>ref: Stop using <code>dropUndefinedKeys</code> in SpanExporter (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15794"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15794/hovercard">#15794</a>)</li>
<li>ref(core): Avoid using <code>SentryError</code> for event processing
control flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15823"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15823/hovercard">#15823</a>)</li>
<li>ref(node): Avoid <code>dropUndefinedKeys</code> in Node SDK init (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15797"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15797/hovercard">#15797</a>)</li>
<li>ref(opentelemetry): Avoid sampling work for non-root spans (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15820"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15820/hovercard">#15820</a>)</li>
</ul>
<p>We've been hard at work making performance improvements to the Sentry
Node SDKs (<code>@ sentry/node</code>, <code>@
sentry/aws-serverless</code>, <code>@ sentry/nestjs</code>, etc.). We've
seen that upgrading from <code>9.7.0</code> to <code>9.10.0</code> leads
to 30-40% improvement in request latency for HTTP web-server
applications that use tracing with high sample rates. Non web-server
applications and non-tracing applications will see smaller
improvements.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>chore(deps): Bump <code>rrweb</code> to <code>2.35.0</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15825"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15825/hovercard">#15825</a>)</li>
<li>deps: Bump bundler plugins to <code>3.2.3</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15829"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15829/hovercard">#15829</a>)</li>
<li>feat: Always truncate stored breadcrumb messages to 2kb (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15819"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15819/hovercard">#15819</a>)</li>
<li>feat(nextjs): Disable server webpack-handling for static builds (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15751"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15751/hovercard">#15751</a>)</li>
<li>fix(nuxt): Don't override Nuxt options if undefined (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15795"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15795/hovercard">#15795</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.08 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>22.88 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.49 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.65 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.3 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.87 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.5 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>24.86 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.39 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.3 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.18 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.12 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.33 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.51 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.53 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.71 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>70.93 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.11 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.4 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.97 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.68 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.92 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.91 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.12 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.46 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmYjEwN2UyYy01YjQ3LTRlMzAtYWM2Ni1iN2NjNmM1NTFmNTAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZiMTA3ZTJjLTViNDctNGUzMC1hYzY2LWI3Y2M2YzU1MWY1MCJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.9.0","to":"9.10.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","prPublicId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3b48baaa-833b-4239-b348-16091472ee83","projectUrl":"https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-03-27T18:39:06.554Z"},"vulns":[]}'
## Podsumowanie wygenerowane przez Sourcery
Aktualizacja @sentry/browser z wersji 9.9.0 do 9.10.0, zawierająca nowe
funkcje i poprawki wydajności.
Nowe funkcje:
- Wprowadzono metody logowania z eksperymentalnym wsparciem logów
- Dodano możliwość łączenia poprzednich śladów (traces) w śledzeniu
przeglądarki (browser tracing)
Ulepszenia:
- Dodano wsparcie dla programowego diagnozowania problemów z łącznością
SDK
- Poprawiono wydajność dla Node SDK dzięki optymalizacjom śledzenia
(tracing optimizations)
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.9.0 to 9.10.0, incorporating new
features and performance improvements
New Features:
- Introduced logging methods with experimental log support
- Added ability to link previous traces in browser tracing
Enhancements:
- Added support for programmatically diagnosing SDK connectivity issues
- Improved performance for Node SDKs with tracing optimizations
</details>
Sign up for freeto 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.

Add previous_trace span link to browserTracingIntegration root spans

2 participants

@Lms24@s1gr1d
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
feat(browser): Add `previous_trace` span links by Lms24 · Pull Request #15569 · getsentry/sentry-javascript · GitHub
Skip to content

feat(browser): Add previous_trace span links - #15569

Merged
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links
Mar 21, 2025
Merged

feat(browser): Add previous_trace span links#15569
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links

Conversation

@Lms24

@Lms24Lms24 commented Mar 4, 2025

Copy link
Copy Markdown
Member

This PR adds logic to set the previous_trace span link on root spans (via browserTracingIntegration).

Some notes:

  • added linkPreviousTrace integration option to control the trace linking behaviour:
    • in-memory - default - previous trace data is linked and stored in memory
    • session-storage - previous trace data is linked and stored in session storage
    • off - no previous trace data is stored or linked
  • we can't yet sample on the previous trace in tracesSampler but this I'll tackle via Add option to sample linked traces consistently #15754
  • everything is implemented within browserTracingIntegration, meaning there's no bundle size hit for error-only users or users who only send manual spans (the latter is a tradeoff but I think it's a fair one)
  • added unit and integration tests for a bunch of scenarios

Happy to bike shed on the options naming :D

closes#14992

UPDATE: I rewrote the public API options from having two options (enablePreviousTrace and persistPreviousTrace) to only one which controls both aspects.

@github-actions

github-actionsBot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.28 KB--
@sentry/browser - with treeshaking flags23.09 KB--
@sentry/browser (incl. Tracing)36.6 KB+0.78%+287 B 🔺
@sentry/browser (incl. Tracing, Replay)73.79 KB+0.41%+305 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags67.14 KB+0.34%+231 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)78.42 KB+0.39%+307 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)90.99 KB+0.37%+338 B 🔺
@sentry/browser (incl. Feedback)40.41 KB--
@sentry/browser (incl. sendFeedback)27.91 KB--
@sentry/browser (incl. FeedbackAsync)32.71 KB--
@sentry/react25.07 KB--
@sentry/react (incl. Tracing)38.53 KB+0.76%+296 B 🔺
@sentry/vue27.5 KB--
@sentry/vue (incl. Tracing)38.3 KB+0.74%+288 B 🔺
@sentry/svelte23.31 KB--
CDN Bundle24.5 KB--
CDN Bundle (incl. Tracing)36.61 KB+0.67%+248 B 🔺
CDN Bundle (incl. Tracing, Replay)71.62 KB+0.33%+235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)76.82 KB+0.31%+236 B 🔺
CDN Bundle - uncompressed71.63 KB--
CDN Bundle (incl. Tracing) - uncompressed108.66 KB+0.62%+684 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed219.92 KB+0.31%+684 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed232.49 KB+0.29%+684 B 🔺
@sentry/nextjs (client)39.81 KB+0.73%+295 B 🔺
@sentry/sveltekit (client)37.03 KB+0.79%+294 B 🔺
@sentry/node142.63 KB--
@sentry/node - without tracing96.01 KB--
@sentry/aws-serverless120.38 KB--

View base workflow run

@Lms24Lms24 self-assigned this Mar 4, 2025
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 66ec822 to 45bc790CompareMarch 19, 2025 15:40
@Lms24
Lms24 marked this pull request as ready for review March 20, 2025 11:51
@Lms24
Lms24 requested review from mydea and s1gr1dMarch 20, 2025 11:51
Comment on lines +396 to +400
previousTraceInfo = addPreviousTraceSpanLink(previousTraceInfo, span);

if (persistPreviousTrace) {
storePreviousTraceInSessionStorage(previousTraceInfo);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think all this code around the previous trace can be put in here. Then there is also no need to mutate the variable or store undefined in a variable if persisting is turned off.

Suggested change
previousTraceInfo=addPreviousTraceSpanLink(previousTraceInfo,span);
if(persistPreviousTrace){
storePreviousTraceInSessionStorage(previousTraceInfo);
}
if(persistPreviousTrace){
constupdatedPreviousTraceInfo=addPreviousTraceSpanLink(
getPreviousTraceFromSessionStorage(),span
)
storePreviousTraceInSessionStorage(updatedPreviousTraceInfo);
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Happy to rewrite this but I still need to call addPreviousTraceSpanLink if persistPreviousTrace is false (as by default). Let me take another look

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I rewrote this a bit based on your suggestion as well as on unifying the two options. b44e790

Comment threadpackages/browser/src/tracing/previousTrace.ts
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 0550ac6 to 6c42afdCompareMarch 20, 2025 14:25
@Lms24
Lms24 requested a review from s1gr1dMarch 21, 2025 09:56

@s1gr1ds1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Such nice API 🥇

@Lms24
Lms24 merged commit 1a4fa0c into developMar 21, 2025
@Lms24
Lms24 deleted the lms/feat-previous-trace-links branch March 21, 2025 10:21
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 17, 2025
![snyk-io[bot]](https://badgen.net/badge/icon/snyk-io%5Bbot%5D/green?label=)
![Contributor](https://badgen.net/badge/icon/Contributor/000000?label=)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.7.0 to
9.9.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **24 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.8.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.8.0">2025-03-21</a></br><ul>
<li>feat(node): Implement new continuous profiling API spec (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15635"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15635/hovercard">#15635</a>)</li>
<li>feat(profiling): Add platform to chunk envelope (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15758"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15758/hovercard">#15758</a>)</li>
<li>feat(react): Export captureReactException method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15746"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15746/hovercard">#15746</a>)</li>
<li>fix(node): Check for <code>res.end</code> before passing to Proxy
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15776"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15776/hovercard">#15776</a>)</li>
<li>perf(core): Add short-circuits to <code>eventFilters</code>
integration (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15752"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15752/hovercard">#15752</a>)</li>
<li>perf(node): Short circuit flushing on Vercel only for Vercel (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15734"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15734/hovercard">#15734</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.29 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.11 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.51 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.15 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.43 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.73 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.1 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.26 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.53 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.04 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.33 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.52 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.38 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.41 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.61 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.68 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.06 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.32 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.88 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.56 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.76 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.65 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.04 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.41 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.7.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.7.0">2025-03-20</a></br><ul>
<li>feat(core): Add <code>captureLog</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15717"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15717/hovercard">#15717</a>)</li>
<li>feat(remix/cloudflare): Export <code>sentryHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15726"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15726/hovercard">#15726</a>)</li>
<li>fix(node): Always flush on Vercel before Lambda freeze (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15602"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15602/hovercard">#15602</a>)</li>
<li>fix(node): Ensure incoming traces are propagated without
HttpInstrumentation (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15732"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15732/hovercard">#15732</a>)</li>
<li>fix(node): Use <code>fatal</code> level for unhandled rejections in
<code>strict</code> mode (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15720"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15720/hovercard">#15720</a>)</li>
<li>fix(nuxt): Delete Nuxt server template injection (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15749"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15749/hovercard">#15749</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.28 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.09 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.33 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.5 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.93 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.13 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.69 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.7 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.08 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.23 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.02 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.3 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.49 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.37 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.57 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.56 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>107.94 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.2 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.77 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.52 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.73 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.62 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.01 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.37 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJjNzI0M2IxOS0yMmVlLTQ5NWItYWJhMS02YjJlOGVhY2FlYjYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImM3MjQzYjE5LTIyZWUtNDk1Yi1hYmExLTZiMmU4ZWFjYWViNiJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.7.0","to":"9.9.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","prPublicId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-03-24T13:46:37.750Z"},"vulns":[]}'
## Podsumowanie od Sourcery
Aktualizacja @sentry/browser z wersji 9.7.0 do 9.9.0
Ulepszenia:
- Dodano wsparcie dla instrumentacji po stronie klienta Next.js
- Wprowadzono możliwość łączenia poprzednich śladów (traces)
- Dodano metody loggera dla nadchodzącego produktu do logowania Sentry
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.7.0 to 9.9.0
Enhancements:
- Added support for Next.js client-side instrumentation
- Introduced ability to link previous traces
- Added logger methods for upcoming Sentry logging product
</details>
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 18, 2025
![reisene](https://badgen.net/badge/icon/reisene/green?label=) [<img
width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
<!--- SUMMARY_MARKER --->
## Sweep Summary <sub><a href="https://app.sweep.dev"><img
src="https://raw.githubusercontent.com/sweepai/sweep/main/.assets/sweep-square.png"
width="25" alt="Sweep"></a></sub>
Adds user registration functionality with email uniqueness validation
and password encoding to the HulajDusza service.
- Created `UserRegistrationDto` with validation annotations for email,
password, and name fields.
- Added `isEmailInUse` method to `UserService` to check if an email is
already registered.
- Implemented `registerUser` method in `UserServiceImpl` that creates a
new user with encoded password.
- Added `/api/users/register` endpoint in `UserController` that handles
user registration requests and returns appropriate HTTP responses.
---
[Ask Sweep AI questions about this PR](https://app.sweep.dev)
<!--- SUMMARY_MARKER --->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.9.0 to
9.10.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **22 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.10.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.10.0">2025-03-27</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat: Add support for logs</strong></p>
<ul>
<li>feat(node): Add logging public APIs to Node SDKs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15764"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15764/hovercard">#15764</a>)</li>
<li>feat(core): Add support for <code>beforeSendLog</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15814"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15814/hovercard">#15814</a>)</li>
<li>feat(core): Add support for parameterizing logs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15812"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15812/hovercard">#15812</a>)</li>
<li>fix: Remove critical log severity level (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15824"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15824/hovercard">#15824</a>)</li>
</ul>
<p>All JavaScript SDKs other than <code>@ sentry/cloudflare</code> and
<code>@ sentry/deno</code> now support sending logs via dedicated
methods as part of Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>.</p>
<p>Logging is gated by an experimental option,
<code>_experiments.enableLogs</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'PUBLIC_DSN',
// `enableLogs` must be set to true to use the logging features
_experiments: { enableLogs: true },
});
const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
trace('Starting database connection', { database: 'users' });
debug('Cache miss for user', { userId: 123 });
error('Failed to process payment', { orderId: 'order_123', amount: 99.99
});
fatal('Database connection pool exhausted', { database: 'users',
activeConnections: 100 });
// Structured logging via the `fmt` helper function. When you use `fmt`,
the string template and parameters are sent separately so they can be
queried independently in Sentry.
info(fmt(`Updated profile for user ${userId}`));
warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests:
${requests}, Limit: ${limit}`));"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'PUBLIC_DSN'</span><span class="pl-kos">,</span>
<span class="pl-c">// `enableLogs` must be set to true to use the
logging features</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> trace<span
class="pl-kos">,</span> debug<span class="pl-kos">,</span> info<span
class="pl-kos">,</span> warn<span class="pl-kos">,</span> error<span
class="pl-kos">,</span> fatal<span class="pl-kos">,</span> fmt <span
class="pl-kos">}</span> <span class="pl-c1">=</span> <span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">;</span>
<span class="pl-en">trace</span><span class="pl-kos">(</span><span
class="pl-s">'Starting database connection'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-en">debug</span><span class="pl-kos">(</span><span
class="pl-s">'Cache miss for user'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">userId</span>: <span
class="pl-c1">123</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">error</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to process payment'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">orderId</span>: <span class="pl-s">'order_123'</span><span
class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span
class="pl-c1">99.99</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">fatal</span><span class="pl-kos">(</span><span
class="pl-s">'Database connection pool exhausted'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span><span
class="pl-kos">,</span> <span class="pl-c1">activeConnections</span>:
<span class="pl-c1">100</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Structured logging via the `fmt` helper function.
When you use `fmt`, the string template and parameters are sent
separately so they can be queried independently in Sentry.</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Updated profile for user <span class="pl-s1"><span
class="pl-kos">${</span><span class="pl-s1">userId</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Rate limit approaching for endpoint <span
class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">endpoint</span><span class="pl-kos">}</span></span>.
Requests: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">requests</span><span class="pl-kos">}</span></span>,
Limit: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">limit</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p>With server-side SDKs like <code>@ sentry/node</code>, <code>@
sentry/bun</code> or server-side of <code>@ sentry/nextjs</code> or
<code>@ sentry/sveltekit</code>, you can do structured logging without
needing the <code>fmt</code> helper function.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const { info, warn }
= Sentry.logger;
info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404
});"><pre><span class="pl-k">const</span> <span class="pl-kos">{</span>
info<span class="pl-kos">,</span> warn <span class="pl-kos">}</span>
<span class="pl-c1">=</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-c1">logger</span><span
class="pl-kos">;</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'User %s logged in successfully'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to load user %s data'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">errorCode</span>: <span class="pl-c1">404</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>To filter logs, or update them before they are sent to Sentry, you
can use the <code>_experiments.beforeSendLog</code> option.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>diagnoseSdkConnectivity()</code>
function to programmatically detect possible connectivity issues (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15821"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15821/hovercard">#15821</a>)</strong></p>
<p>The <code>diagnoseSdkConnectivity()</code> function can be used to
programmatically detect possible connectivity issues with the Sentry
SDK.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const result = await
Sentry.diagnoseSdkConnectivity();"><pre><span class="pl-k">const</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span
class="pl-k">await</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span
class="pl-en">diagnoseSdkConnectivity</span><span
class="pl-kos">(</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>The result will be an object with the following properties:</p>
<ul>
<li><code>"no-client-active"</code>: There was no active client when the
function was called. This possibly means that the SDK was not
initialized yet.</li>
<li><code>"sentry-unreachable"</code>: The Sentry SaaS servers were not
reachable. This likely means that there is an ad blocker active on the
page or that there are other connection issues.</li>
<li><code>undefined</code>: The SDK is working as expected.</li>
</ul>
</li>
<li>
<p><strong>SDK Tracing Performance Improvements for Node
SDKs</strong></p>
<ul>
<li>feat: Stop using <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15796"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15796/hovercard">#15796</a>)</li>
<li>feat(node): Only add span listeners for instrumentation when used
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15802"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15802/hovercard">#15802</a>)</li>
<li>ref: Avoid <code>dropUndefinedKeys</code> for
<code>spanToJSON</code> calls (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15792"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15792/hovercard">#15792</a>)</li>
<li>ref: Avoid using <code>SentryError</code> for PromiseBuffer control
flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15822"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15822/hovercard">#15822</a>)</li>
<li>ref: Stop using <code>dropUndefinedKeys</code> in SpanExporter (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15794"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15794/hovercard">#15794</a>)</li>
<li>ref(core): Avoid using <code>SentryError</code> for event processing
control flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15823"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15823/hovercard">#15823</a>)</li>
<li>ref(node): Avoid <code>dropUndefinedKeys</code> in Node SDK init (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15797"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15797/hovercard">#15797</a>)</li>
<li>ref(opentelemetry): Avoid sampling work for non-root spans (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15820"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15820/hovercard">#15820</a>)</li>
</ul>
<p>We've been hard at work making performance improvements to the Sentry
Node SDKs (<code>@ sentry/node</code>, <code>@
sentry/aws-serverless</code>, <code>@ sentry/nestjs</code>, etc.). We've
seen that upgrading from <code>9.7.0</code> to <code>9.10.0</code> leads
to 30-40% improvement in request latency for HTTP web-server
applications that use tracing with high sample rates. Non web-server
applications and non-tracing applications will see smaller
improvements.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>chore(deps): Bump <code>rrweb</code> to <code>2.35.0</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15825"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15825/hovercard">#15825</a>)</li>
<li>deps: Bump bundler plugins to <code>3.2.3</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15829"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15829/hovercard">#15829</a>)</li>
<li>feat: Always truncate stored breadcrumb messages to 2kb (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15819"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15819/hovercard">#15819</a>)</li>
<li>feat(nextjs): Disable server webpack-handling for static builds (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15751"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15751/hovercard">#15751</a>)</li>
<li>fix(nuxt): Don't override Nuxt options if undefined (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15795"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15795/hovercard">#15795</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.08 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>22.88 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.49 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.65 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.3 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.87 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.5 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>24.86 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.39 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.3 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.18 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.12 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.33 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.51 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.53 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.71 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>70.93 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.11 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.4 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.97 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.68 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.92 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.91 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.12 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.46 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmYjEwN2UyYy01YjQ3LTRlMzAtYWM2Ni1iN2NjNmM1NTFmNTAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZiMTA3ZTJjLTViNDctNGUzMC1hYzY2LWI3Y2M2YzU1MWY1MCJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.9.0","to":"9.10.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","prPublicId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3b48baaa-833b-4239-b348-16091472ee83","projectUrl":"https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-03-27T18:39:06.554Z"},"vulns":[]}'
## Podsumowanie wygenerowane przez Sourcery
Aktualizacja @sentry/browser z wersji 9.9.0 do 9.10.0, zawierająca nowe
funkcje i poprawki wydajności.
Nowe funkcje:
- Wprowadzono metody logowania z eksperymentalnym wsparciem logów
- Dodano możliwość łączenia poprzednich śladów (traces) w śledzeniu
przeglądarki (browser tracing)
Ulepszenia:
- Dodano wsparcie dla programowego diagnozowania problemów z łącznością
SDK
- Poprawiono wydajność dla Node SDK dzięki optymalizacjom śledzenia
(tracing optimizations)
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.9.0 to 9.10.0, incorporating new
features and performance improvements
New Features:
- Introduced logging methods with experimental log support
- Added ability to link previous traces in browser tracing
Enhancements:
- Added support for programmatically diagnosing SDK connectivity issues
- Improved performance for Node SDKs with tracing optimizations
</details>
Sign up for freeto 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.

Add previous_trace span link to browserTracingIntegration root spans

2 participants

@Lms24@s1gr1d
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat(browser): Add `previous_trace` span links by Lms24 · Pull Request #15569 · getsentry/sentry-javascript · GitHub
Skip to content

feat(browser): Add previous_trace span links - #15569

Merged
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links
Mar 21, 2025
Merged

feat(browser): Add previous_trace span links#15569
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links

Conversation

@Lms24

@Lms24Lms24 commented Mar 4, 2025

Copy link
Copy Markdown
Member

This PR adds logic to set the previous_trace span link on root spans (via browserTracingIntegration).

Some notes:

  • added linkPreviousTrace integration option to control the trace linking behaviour:
    • in-memory - default - previous trace data is linked and stored in memory
    • session-storage - previous trace data is linked and stored in session storage
    • off - no previous trace data is stored or linked
  • we can't yet sample on the previous trace in tracesSampler but this I'll tackle via Add option to sample linked traces consistently #15754
  • everything is implemented within browserTracingIntegration, meaning there's no bundle size hit for error-only users or users who only send manual spans (the latter is a tradeoff but I think it's a fair one)
  • added unit and integration tests for a bunch of scenarios

Happy to bike shed on the options naming :D

closes#14992

UPDATE: I rewrote the public API options from having two options (enablePreviousTrace and persistPreviousTrace) to only one which controls both aspects.

@github-actions

github-actionsBot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.28 KB--
@sentry/browser - with treeshaking flags23.09 KB--
@sentry/browser (incl. Tracing)36.6 KB+0.78%+287 B 🔺
@sentry/browser (incl. Tracing, Replay)73.79 KB+0.41%+305 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags67.14 KB+0.34%+231 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)78.42 KB+0.39%+307 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)90.99 KB+0.37%+338 B 🔺
@sentry/browser (incl. Feedback)40.41 KB--
@sentry/browser (incl. sendFeedback)27.91 KB--
@sentry/browser (incl. FeedbackAsync)32.71 KB--
@sentry/react25.07 KB--
@sentry/react (incl. Tracing)38.53 KB+0.76%+296 B 🔺
@sentry/vue27.5 KB--
@sentry/vue (incl. Tracing)38.3 KB+0.74%+288 B 🔺
@sentry/svelte23.31 KB--
CDN Bundle24.5 KB--
CDN Bundle (incl. Tracing)36.61 KB+0.67%+248 B 🔺
CDN Bundle (incl. Tracing, Replay)71.62 KB+0.33%+235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)76.82 KB+0.31%+236 B 🔺
CDN Bundle - uncompressed71.63 KB--
CDN Bundle (incl. Tracing) - uncompressed108.66 KB+0.62%+684 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed219.92 KB+0.31%+684 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed232.49 KB+0.29%+684 B 🔺
@sentry/nextjs (client)39.81 KB+0.73%+295 B 🔺
@sentry/sveltekit (client)37.03 KB+0.79%+294 B 🔺
@sentry/node142.63 KB--
@sentry/node - without tracing96.01 KB--
@sentry/aws-serverless120.38 KB--

View base workflow run

@Lms24Lms24 self-assigned this Mar 4, 2025
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 66ec822 to 45bc790CompareMarch 19, 2025 15:40
@Lms24
Lms24 marked this pull request as ready for review March 20, 2025 11:51
@Lms24
Lms24 requested review from mydea and s1gr1dMarch 20, 2025 11:51
Comment on lines +396 to +400
previousTraceInfo = addPreviousTraceSpanLink(previousTraceInfo, span);

if (persistPreviousTrace) {
storePreviousTraceInSessionStorage(previousTraceInfo);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think all this code around the previous trace can be put in here. Then there is also no need to mutate the variable or store undefined in a variable if persisting is turned off.

Suggested change
previousTraceInfo=addPreviousTraceSpanLink(previousTraceInfo,span);
if(persistPreviousTrace){
storePreviousTraceInSessionStorage(previousTraceInfo);
}
if(persistPreviousTrace){
constupdatedPreviousTraceInfo=addPreviousTraceSpanLink(
getPreviousTraceFromSessionStorage(),span
)
storePreviousTraceInSessionStorage(updatedPreviousTraceInfo);
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Happy to rewrite this but I still need to call addPreviousTraceSpanLink if persistPreviousTrace is false (as by default). Let me take another look

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I rewrote this a bit based on your suggestion as well as on unifying the two options. b44e790

Comment threadpackages/browser/src/tracing/previousTrace.ts
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 0550ac6 to 6c42afdCompareMarch 20, 2025 14:25
@Lms24
Lms24 requested a review from s1gr1dMarch 21, 2025 09:56

@s1gr1ds1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Such nice API 🥇

@Lms24
Lms24 merged commit 1a4fa0c into developMar 21, 2025
@Lms24
Lms24 deleted the lms/feat-previous-trace-links branch March 21, 2025 10:21
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 17, 2025
![snyk-io[bot]](https://badgen.net/badge/icon/snyk-io%5Bbot%5D/green?label=)
![Contributor](https://badgen.net/badge/icon/Contributor/000000?label=)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.7.0 to
9.9.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **24 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.8.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.8.0">2025-03-21</a></br><ul>
<li>feat(node): Implement new continuous profiling API spec (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15635"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15635/hovercard">#15635</a>)</li>
<li>feat(profiling): Add platform to chunk envelope (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15758"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15758/hovercard">#15758</a>)</li>
<li>feat(react): Export captureReactException method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15746"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15746/hovercard">#15746</a>)</li>
<li>fix(node): Check for <code>res.end</code> before passing to Proxy
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15776"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15776/hovercard">#15776</a>)</li>
<li>perf(core): Add short-circuits to <code>eventFilters</code>
integration (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15752"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15752/hovercard">#15752</a>)</li>
<li>perf(node): Short circuit flushing on Vercel only for Vercel (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15734"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15734/hovercard">#15734</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.29 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.11 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.51 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.15 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.43 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.73 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.1 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.26 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.53 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.04 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.33 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.52 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.38 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.41 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.61 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.68 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.06 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.32 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.88 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.56 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.76 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.65 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.04 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.41 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.7.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.7.0">2025-03-20</a></br><ul>
<li>feat(core): Add <code>captureLog</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15717"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15717/hovercard">#15717</a>)</li>
<li>feat(remix/cloudflare): Export <code>sentryHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15726"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15726/hovercard">#15726</a>)</li>
<li>fix(node): Always flush on Vercel before Lambda freeze (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15602"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15602/hovercard">#15602</a>)</li>
<li>fix(node): Ensure incoming traces are propagated without
HttpInstrumentation (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15732"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15732/hovercard">#15732</a>)</li>
<li>fix(node): Use <code>fatal</code> level for unhandled rejections in
<code>strict</code> mode (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15720"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15720/hovercard">#15720</a>)</li>
<li>fix(nuxt): Delete Nuxt server template injection (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15749"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15749/hovercard">#15749</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.28 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.09 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.33 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.5 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.93 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.13 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.69 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.7 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.08 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.23 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.02 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.3 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.49 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.37 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.57 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.56 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>107.94 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.2 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.77 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.52 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.73 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.62 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.01 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.37 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJjNzI0M2IxOS0yMmVlLTQ5NWItYWJhMS02YjJlOGVhY2FlYjYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImM3MjQzYjE5LTIyZWUtNDk1Yi1hYmExLTZiMmU4ZWFjYWViNiJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.7.0","to":"9.9.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","prPublicId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-03-24T13:46:37.750Z"},"vulns":[]}'
## Podsumowanie od Sourcery
Aktualizacja @sentry/browser z wersji 9.7.0 do 9.9.0
Ulepszenia:
- Dodano wsparcie dla instrumentacji po stronie klienta Next.js
- Wprowadzono możliwość łączenia poprzednich śladów (traces)
- Dodano metody loggera dla nadchodzącego produktu do logowania Sentry
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.7.0 to 9.9.0
Enhancements:
- Added support for Next.js client-side instrumentation
- Introduced ability to link previous traces
- Added logger methods for upcoming Sentry logging product
</details>
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 18, 2025
![reisene](https://badgen.net/badge/icon/reisene/green?label=) [<img
width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
<!--- SUMMARY_MARKER --->
## Sweep Summary <sub><a href="https://app.sweep.dev"><img
src="https://raw.githubusercontent.com/sweepai/sweep/main/.assets/sweep-square.png"
width="25" alt="Sweep"></a></sub>
Adds user registration functionality with email uniqueness validation
and password encoding to the HulajDusza service.
- Created `UserRegistrationDto` with validation annotations for email,
password, and name fields.
- Added `isEmailInUse` method to `UserService` to check if an email is
already registered.
- Implemented `registerUser` method in `UserServiceImpl` that creates a
new user with encoded password.
- Added `/api/users/register` endpoint in `UserController` that handles
user registration requests and returns appropriate HTTP responses.
---
[Ask Sweep AI questions about this PR](https://app.sweep.dev)
<!--- SUMMARY_MARKER --->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.9.0 to
9.10.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **22 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.10.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.10.0">2025-03-27</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat: Add support for logs</strong></p>
<ul>
<li>feat(node): Add logging public APIs to Node SDKs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15764"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15764/hovercard">#15764</a>)</li>
<li>feat(core): Add support for <code>beforeSendLog</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15814"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15814/hovercard">#15814</a>)</li>
<li>feat(core): Add support for parameterizing logs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15812"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15812/hovercard">#15812</a>)</li>
<li>fix: Remove critical log severity level (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15824"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15824/hovercard">#15824</a>)</li>
</ul>
<p>All JavaScript SDKs other than <code>@ sentry/cloudflare</code> and
<code>@ sentry/deno</code> now support sending logs via dedicated
methods as part of Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>.</p>
<p>Logging is gated by an experimental option,
<code>_experiments.enableLogs</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'PUBLIC_DSN',
// `enableLogs` must be set to true to use the logging features
_experiments: { enableLogs: true },
});
const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
trace('Starting database connection', { database: 'users' });
debug('Cache miss for user', { userId: 123 });
error('Failed to process payment', { orderId: 'order_123', amount: 99.99
});
fatal('Database connection pool exhausted', { database: 'users',
activeConnections: 100 });
// Structured logging via the `fmt` helper function. When you use `fmt`,
the string template and parameters are sent separately so they can be
queried independently in Sentry.
info(fmt(`Updated profile for user ${userId}`));
warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests:
${requests}, Limit: ${limit}`));"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'PUBLIC_DSN'</span><span class="pl-kos">,</span>
<span class="pl-c">// `enableLogs` must be set to true to use the
logging features</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> trace<span
class="pl-kos">,</span> debug<span class="pl-kos">,</span> info<span
class="pl-kos">,</span> warn<span class="pl-kos">,</span> error<span
class="pl-kos">,</span> fatal<span class="pl-kos">,</span> fmt <span
class="pl-kos">}</span> <span class="pl-c1">=</span> <span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">;</span>
<span class="pl-en">trace</span><span class="pl-kos">(</span><span
class="pl-s">'Starting database connection'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-en">debug</span><span class="pl-kos">(</span><span
class="pl-s">'Cache miss for user'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">userId</span>: <span
class="pl-c1">123</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">error</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to process payment'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">orderId</span>: <span class="pl-s">'order_123'</span><span
class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span
class="pl-c1">99.99</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">fatal</span><span class="pl-kos">(</span><span
class="pl-s">'Database connection pool exhausted'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span><span
class="pl-kos">,</span> <span class="pl-c1">activeConnections</span>:
<span class="pl-c1">100</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Structured logging via the `fmt` helper function.
When you use `fmt`, the string template and parameters are sent
separately so they can be queried independently in Sentry.</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Updated profile for user <span class="pl-s1"><span
class="pl-kos">${</span><span class="pl-s1">userId</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Rate limit approaching for endpoint <span
class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">endpoint</span><span class="pl-kos">}</span></span>.
Requests: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">requests</span><span class="pl-kos">}</span></span>,
Limit: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">limit</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p>With server-side SDKs like <code>@ sentry/node</code>, <code>@
sentry/bun</code> or server-side of <code>@ sentry/nextjs</code> or
<code>@ sentry/sveltekit</code>, you can do structured logging without
needing the <code>fmt</code> helper function.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const { info, warn }
= Sentry.logger;
info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404
});"><pre><span class="pl-k">const</span> <span class="pl-kos">{</span>
info<span class="pl-kos">,</span> warn <span class="pl-kos">}</span>
<span class="pl-c1">=</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-c1">logger</span><span
class="pl-kos">;</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'User %s logged in successfully'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to load user %s data'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">errorCode</span>: <span class="pl-c1">404</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>To filter logs, or update them before they are sent to Sentry, you
can use the <code>_experiments.beforeSendLog</code> option.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>diagnoseSdkConnectivity()</code>
function to programmatically detect possible connectivity issues (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15821"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15821/hovercard">#15821</a>)</strong></p>
<p>The <code>diagnoseSdkConnectivity()</code> function can be used to
programmatically detect possible connectivity issues with the Sentry
SDK.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const result = await
Sentry.diagnoseSdkConnectivity();"><pre><span class="pl-k">const</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span
class="pl-k">await</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span
class="pl-en">diagnoseSdkConnectivity</span><span
class="pl-kos">(</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>The result will be an object with the following properties:</p>
<ul>
<li><code>"no-client-active"</code>: There was no active client when the
function was called. This possibly means that the SDK was not
initialized yet.</li>
<li><code>"sentry-unreachable"</code>: The Sentry SaaS servers were not
reachable. This likely means that there is an ad blocker active on the
page or that there are other connection issues.</li>
<li><code>undefined</code>: The SDK is working as expected.</li>
</ul>
</li>
<li>
<p><strong>SDK Tracing Performance Improvements for Node
SDKs</strong></p>
<ul>
<li>feat: Stop using <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15796"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15796/hovercard">#15796</a>)</li>
<li>feat(node): Only add span listeners for instrumentation when used
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15802"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15802/hovercard">#15802</a>)</li>
<li>ref: Avoid <code>dropUndefinedKeys</code> for
<code>spanToJSON</code> calls (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15792"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15792/hovercard">#15792</a>)</li>
<li>ref: Avoid using <code>SentryError</code> for PromiseBuffer control
flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15822"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15822/hovercard">#15822</a>)</li>
<li>ref: Stop using <code>dropUndefinedKeys</code> in SpanExporter (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15794"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15794/hovercard">#15794</a>)</li>
<li>ref(core): Avoid using <code>SentryError</code> for event processing
control flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15823"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15823/hovercard">#15823</a>)</li>
<li>ref(node): Avoid <code>dropUndefinedKeys</code> in Node SDK init (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15797"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15797/hovercard">#15797</a>)</li>
<li>ref(opentelemetry): Avoid sampling work for non-root spans (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15820"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15820/hovercard">#15820</a>)</li>
</ul>
<p>We've been hard at work making performance improvements to the Sentry
Node SDKs (<code>@ sentry/node</code>, <code>@
sentry/aws-serverless</code>, <code>@ sentry/nestjs</code>, etc.). We've
seen that upgrading from <code>9.7.0</code> to <code>9.10.0</code> leads
to 30-40% improvement in request latency for HTTP web-server
applications that use tracing with high sample rates. Non web-server
applications and non-tracing applications will see smaller
improvements.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>chore(deps): Bump <code>rrweb</code> to <code>2.35.0</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15825"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15825/hovercard">#15825</a>)</li>
<li>deps: Bump bundler plugins to <code>3.2.3</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15829"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15829/hovercard">#15829</a>)</li>
<li>feat: Always truncate stored breadcrumb messages to 2kb (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15819"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15819/hovercard">#15819</a>)</li>
<li>feat(nextjs): Disable server webpack-handling for static builds (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15751"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15751/hovercard">#15751</a>)</li>
<li>fix(nuxt): Don't override Nuxt options if undefined (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15795"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15795/hovercard">#15795</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.08 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>22.88 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.49 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.65 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.3 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.87 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.5 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>24.86 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.39 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.3 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.18 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.12 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.33 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.51 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.53 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.71 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>70.93 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.11 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.4 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.97 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.68 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.92 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.91 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.12 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.46 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmYjEwN2UyYy01YjQ3LTRlMzAtYWM2Ni1iN2NjNmM1NTFmNTAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZiMTA3ZTJjLTViNDctNGUzMC1hYzY2LWI3Y2M2YzU1MWY1MCJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.9.0","to":"9.10.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","prPublicId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3b48baaa-833b-4239-b348-16091472ee83","projectUrl":"https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-03-27T18:39:06.554Z"},"vulns":[]}'
## Podsumowanie wygenerowane przez Sourcery
Aktualizacja @sentry/browser z wersji 9.9.0 do 9.10.0, zawierająca nowe
funkcje i poprawki wydajności.
Nowe funkcje:
- Wprowadzono metody logowania z eksperymentalnym wsparciem logów
- Dodano możliwość łączenia poprzednich śladów (traces) w śledzeniu
przeglądarki (browser tracing)
Ulepszenia:
- Dodano wsparcie dla programowego diagnozowania problemów z łącznością
SDK
- Poprawiono wydajność dla Node SDK dzięki optymalizacjom śledzenia
(tracing optimizations)
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.9.0 to 9.10.0, incorporating new
features and performance improvements
New Features:
- Introduced logging methods with experimental log support
- Added ability to link previous traces in browser tracing
Enhancements:
- Added support for programmatically diagnosing SDK connectivity issues
- Improved performance for Node SDKs with tracing optimizations
</details>
Sign up for freeto 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.

Add previous_trace span link to browserTracingIntegration root spans

2 participants

@Lms24@s1gr1d
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat(browser): Add `previous_trace` span links by Lms24 · Pull Request #15569 · getsentry/sentry-javascript · GitHub
Skip to content

feat(browser): Add previous_trace span links - #15569

Merged
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links
Mar 21, 2025
Merged

feat(browser): Add previous_trace span links#15569
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links

Conversation

@Lms24

@Lms24Lms24 commented Mar 4, 2025

Copy link
Copy Markdown
Member

This PR adds logic to set the previous_trace span link on root spans (via browserTracingIntegration).

Some notes:

  • added linkPreviousTrace integration option to control the trace linking behaviour:
    • in-memory - default - previous trace data is linked and stored in memory
    • session-storage - previous trace data is linked and stored in session storage
    • off - no previous trace data is stored or linked
  • we can't yet sample on the previous trace in tracesSampler but this I'll tackle via Add option to sample linked traces consistently #15754
  • everything is implemented within browserTracingIntegration, meaning there's no bundle size hit for error-only users or users who only send manual spans (the latter is a tradeoff but I think it's a fair one)
  • added unit and integration tests for a bunch of scenarios

Happy to bike shed on the options naming :D

closes#14992

UPDATE: I rewrote the public API options from having two options (enablePreviousTrace and persistPreviousTrace) to only one which controls both aspects.

@github-actions

github-actionsBot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.28 KB--
@sentry/browser - with treeshaking flags23.09 KB--
@sentry/browser (incl. Tracing)36.6 KB+0.78%+287 B 🔺
@sentry/browser (incl. Tracing, Replay)73.79 KB+0.41%+305 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags67.14 KB+0.34%+231 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)78.42 KB+0.39%+307 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)90.99 KB+0.37%+338 B 🔺
@sentry/browser (incl. Feedback)40.41 KB--
@sentry/browser (incl. sendFeedback)27.91 KB--
@sentry/browser (incl. FeedbackAsync)32.71 KB--
@sentry/react25.07 KB--
@sentry/react (incl. Tracing)38.53 KB+0.76%+296 B 🔺
@sentry/vue27.5 KB--
@sentry/vue (incl. Tracing)38.3 KB+0.74%+288 B 🔺
@sentry/svelte23.31 KB--
CDN Bundle24.5 KB--
CDN Bundle (incl. Tracing)36.61 KB+0.67%+248 B 🔺
CDN Bundle (incl. Tracing, Replay)71.62 KB+0.33%+235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)76.82 KB+0.31%+236 B 🔺
CDN Bundle - uncompressed71.63 KB--
CDN Bundle (incl. Tracing) - uncompressed108.66 KB+0.62%+684 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed219.92 KB+0.31%+684 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed232.49 KB+0.29%+684 B 🔺
@sentry/nextjs (client)39.81 KB+0.73%+295 B 🔺
@sentry/sveltekit (client)37.03 KB+0.79%+294 B 🔺
@sentry/node142.63 KB--
@sentry/node - without tracing96.01 KB--
@sentry/aws-serverless120.38 KB--

View base workflow run

@Lms24Lms24 self-assigned this Mar 4, 2025
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 66ec822 to 45bc790CompareMarch 19, 2025 15:40
@Lms24
Lms24 marked this pull request as ready for review March 20, 2025 11:51
@Lms24
Lms24 requested review from mydea and s1gr1dMarch 20, 2025 11:51
Comment on lines +396 to +400
previousTraceInfo = addPreviousTraceSpanLink(previousTraceInfo, span);

if (persistPreviousTrace) {
storePreviousTraceInSessionStorage(previousTraceInfo);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think all this code around the previous trace can be put in here. Then there is also no need to mutate the variable or store undefined in a variable if persisting is turned off.

Suggested change
previousTraceInfo=addPreviousTraceSpanLink(previousTraceInfo,span);
if(persistPreviousTrace){
storePreviousTraceInSessionStorage(previousTraceInfo);
}
if(persistPreviousTrace){
constupdatedPreviousTraceInfo=addPreviousTraceSpanLink(
getPreviousTraceFromSessionStorage(),span
)
storePreviousTraceInSessionStorage(updatedPreviousTraceInfo);
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Happy to rewrite this but I still need to call addPreviousTraceSpanLink if persistPreviousTrace is false (as by default). Let me take another look

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I rewrote this a bit based on your suggestion as well as on unifying the two options. b44e790

Comment threadpackages/browser/src/tracing/previousTrace.ts
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 0550ac6 to 6c42afdCompareMarch 20, 2025 14:25
@Lms24
Lms24 requested a review from s1gr1dMarch 21, 2025 09:56

@s1gr1ds1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Such nice API 🥇

@Lms24
Lms24 merged commit 1a4fa0c into developMar 21, 2025
@Lms24
Lms24 deleted the lms/feat-previous-trace-links branch March 21, 2025 10:21
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 17, 2025
![snyk-io[bot]](https://badgen.net/badge/icon/snyk-io%5Bbot%5D/green?label=)
![Contributor](https://badgen.net/badge/icon/Contributor/000000?label=)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.7.0 to
9.9.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **24 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.8.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.8.0">2025-03-21</a></br><ul>
<li>feat(node): Implement new continuous profiling API spec (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15635"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15635/hovercard">#15635</a>)</li>
<li>feat(profiling): Add platform to chunk envelope (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15758"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15758/hovercard">#15758</a>)</li>
<li>feat(react): Export captureReactException method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15746"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15746/hovercard">#15746</a>)</li>
<li>fix(node): Check for <code>res.end</code> before passing to Proxy
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15776"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15776/hovercard">#15776</a>)</li>
<li>perf(core): Add short-circuits to <code>eventFilters</code>
integration (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15752"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15752/hovercard">#15752</a>)</li>
<li>perf(node): Short circuit flushing on Vercel only for Vercel (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15734"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15734/hovercard">#15734</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.29 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.11 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.51 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.15 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.43 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.73 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.1 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.26 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.53 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.04 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.33 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.52 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.38 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.41 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.61 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.68 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.06 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.32 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.88 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.56 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.76 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.65 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.04 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.41 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.7.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.7.0">2025-03-20</a></br><ul>
<li>feat(core): Add <code>captureLog</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15717"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15717/hovercard">#15717</a>)</li>
<li>feat(remix/cloudflare): Export <code>sentryHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15726"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15726/hovercard">#15726</a>)</li>
<li>fix(node): Always flush on Vercel before Lambda freeze (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15602"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15602/hovercard">#15602</a>)</li>
<li>fix(node): Ensure incoming traces are propagated without
HttpInstrumentation (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15732"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15732/hovercard">#15732</a>)</li>
<li>fix(node): Use <code>fatal</code> level for unhandled rejections in
<code>strict</code> mode (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15720"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15720/hovercard">#15720</a>)</li>
<li>fix(nuxt): Delete Nuxt server template injection (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15749"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15749/hovercard">#15749</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.28 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.09 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.33 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.5 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.93 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.13 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.69 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.7 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.08 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.23 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.02 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.3 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.49 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.37 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.57 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.56 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>107.94 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.2 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.77 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.52 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.73 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.62 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.01 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.37 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJjNzI0M2IxOS0yMmVlLTQ5NWItYWJhMS02YjJlOGVhY2FlYjYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImM3MjQzYjE5LTIyZWUtNDk1Yi1hYmExLTZiMmU4ZWFjYWViNiJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.7.0","to":"9.9.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","prPublicId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-03-24T13:46:37.750Z"},"vulns":[]}'
## Podsumowanie od Sourcery
Aktualizacja @sentry/browser z wersji 9.7.0 do 9.9.0
Ulepszenia:
- Dodano wsparcie dla instrumentacji po stronie klienta Next.js
- Wprowadzono możliwość łączenia poprzednich śladów (traces)
- Dodano metody loggera dla nadchodzącego produktu do logowania Sentry
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.7.0 to 9.9.0
Enhancements:
- Added support for Next.js client-side instrumentation
- Introduced ability to link previous traces
- Added logger methods for upcoming Sentry logging product
</details>
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 18, 2025
![reisene](https://badgen.net/badge/icon/reisene/green?label=) [<img
width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
<!--- SUMMARY_MARKER --->
## Sweep Summary <sub><a href="https://app.sweep.dev"><img
src="https://raw.githubusercontent.com/sweepai/sweep/main/.assets/sweep-square.png"
width="25" alt="Sweep"></a></sub>
Adds user registration functionality with email uniqueness validation
and password encoding to the HulajDusza service.
- Created `UserRegistrationDto` with validation annotations for email,
password, and name fields.
- Added `isEmailInUse` method to `UserService` to check if an email is
already registered.
- Implemented `registerUser` method in `UserServiceImpl` that creates a
new user with encoded password.
- Added `/api/users/register` endpoint in `UserController` that handles
user registration requests and returns appropriate HTTP responses.
---
[Ask Sweep AI questions about this PR](https://app.sweep.dev)
<!--- SUMMARY_MARKER --->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.9.0 to
9.10.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **22 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.10.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.10.0">2025-03-27</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat: Add support for logs</strong></p>
<ul>
<li>feat(node): Add logging public APIs to Node SDKs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15764"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15764/hovercard">#15764</a>)</li>
<li>feat(core): Add support for <code>beforeSendLog</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15814"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15814/hovercard">#15814</a>)</li>
<li>feat(core): Add support for parameterizing logs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15812"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15812/hovercard">#15812</a>)</li>
<li>fix: Remove critical log severity level (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15824"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15824/hovercard">#15824</a>)</li>
</ul>
<p>All JavaScript SDKs other than <code>@ sentry/cloudflare</code> and
<code>@ sentry/deno</code> now support sending logs via dedicated
methods as part of Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>.</p>
<p>Logging is gated by an experimental option,
<code>_experiments.enableLogs</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'PUBLIC_DSN',
// `enableLogs` must be set to true to use the logging features
_experiments: { enableLogs: true },
});
const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
trace('Starting database connection', { database: 'users' });
debug('Cache miss for user', { userId: 123 });
error('Failed to process payment', { orderId: 'order_123', amount: 99.99
});
fatal('Database connection pool exhausted', { database: 'users',
activeConnections: 100 });
// Structured logging via the `fmt` helper function. When you use `fmt`,
the string template and parameters are sent separately so they can be
queried independently in Sentry.
info(fmt(`Updated profile for user ${userId}`));
warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests:
${requests}, Limit: ${limit}`));"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'PUBLIC_DSN'</span><span class="pl-kos">,</span>
<span class="pl-c">// `enableLogs` must be set to true to use the
logging features</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> trace<span
class="pl-kos">,</span> debug<span class="pl-kos">,</span> info<span
class="pl-kos">,</span> warn<span class="pl-kos">,</span> error<span
class="pl-kos">,</span> fatal<span class="pl-kos">,</span> fmt <span
class="pl-kos">}</span> <span class="pl-c1">=</span> <span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">;</span>
<span class="pl-en">trace</span><span class="pl-kos">(</span><span
class="pl-s">'Starting database connection'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-en">debug</span><span class="pl-kos">(</span><span
class="pl-s">'Cache miss for user'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">userId</span>: <span
class="pl-c1">123</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">error</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to process payment'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">orderId</span>: <span class="pl-s">'order_123'</span><span
class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span
class="pl-c1">99.99</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">fatal</span><span class="pl-kos">(</span><span
class="pl-s">'Database connection pool exhausted'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span><span
class="pl-kos">,</span> <span class="pl-c1">activeConnections</span>:
<span class="pl-c1">100</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Structured logging via the `fmt` helper function.
When you use `fmt`, the string template and parameters are sent
separately so they can be queried independently in Sentry.</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Updated profile for user <span class="pl-s1"><span
class="pl-kos">${</span><span class="pl-s1">userId</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Rate limit approaching for endpoint <span
class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">endpoint</span><span class="pl-kos">}</span></span>.
Requests: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">requests</span><span class="pl-kos">}</span></span>,
Limit: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">limit</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p>With server-side SDKs like <code>@ sentry/node</code>, <code>@
sentry/bun</code> or server-side of <code>@ sentry/nextjs</code> or
<code>@ sentry/sveltekit</code>, you can do structured logging without
needing the <code>fmt</code> helper function.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const { info, warn }
= Sentry.logger;
info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404
});"><pre><span class="pl-k">const</span> <span class="pl-kos">{</span>
info<span class="pl-kos">,</span> warn <span class="pl-kos">}</span>
<span class="pl-c1">=</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-c1">logger</span><span
class="pl-kos">;</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'User %s logged in successfully'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to load user %s data'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">errorCode</span>: <span class="pl-c1">404</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>To filter logs, or update them before they are sent to Sentry, you
can use the <code>_experiments.beforeSendLog</code> option.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>diagnoseSdkConnectivity()</code>
function to programmatically detect possible connectivity issues (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15821"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15821/hovercard">#15821</a>)</strong></p>
<p>The <code>diagnoseSdkConnectivity()</code> function can be used to
programmatically detect possible connectivity issues with the Sentry
SDK.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const result = await
Sentry.diagnoseSdkConnectivity();"><pre><span class="pl-k">const</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span
class="pl-k">await</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span
class="pl-en">diagnoseSdkConnectivity</span><span
class="pl-kos">(</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>The result will be an object with the following properties:</p>
<ul>
<li><code>"no-client-active"</code>: There was no active client when the
function was called. This possibly means that the SDK was not
initialized yet.</li>
<li><code>"sentry-unreachable"</code>: The Sentry SaaS servers were not
reachable. This likely means that there is an ad blocker active on the
page or that there are other connection issues.</li>
<li><code>undefined</code>: The SDK is working as expected.</li>
</ul>
</li>
<li>
<p><strong>SDK Tracing Performance Improvements for Node
SDKs</strong></p>
<ul>
<li>feat: Stop using <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15796"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15796/hovercard">#15796</a>)</li>
<li>feat(node): Only add span listeners for instrumentation when used
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15802"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15802/hovercard">#15802</a>)</li>
<li>ref: Avoid <code>dropUndefinedKeys</code> for
<code>spanToJSON</code> calls (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15792"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15792/hovercard">#15792</a>)</li>
<li>ref: Avoid using <code>SentryError</code> for PromiseBuffer control
flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15822"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15822/hovercard">#15822</a>)</li>
<li>ref: Stop using <code>dropUndefinedKeys</code> in SpanExporter (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15794"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15794/hovercard">#15794</a>)</li>
<li>ref(core): Avoid using <code>SentryError</code> for event processing
control flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15823"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15823/hovercard">#15823</a>)</li>
<li>ref(node): Avoid <code>dropUndefinedKeys</code> in Node SDK init (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15797"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15797/hovercard">#15797</a>)</li>
<li>ref(opentelemetry): Avoid sampling work for non-root spans (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15820"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15820/hovercard">#15820</a>)</li>
</ul>
<p>We've been hard at work making performance improvements to the Sentry
Node SDKs (<code>@ sentry/node</code>, <code>@
sentry/aws-serverless</code>, <code>@ sentry/nestjs</code>, etc.). We've
seen that upgrading from <code>9.7.0</code> to <code>9.10.0</code> leads
to 30-40% improvement in request latency for HTTP web-server
applications that use tracing with high sample rates. Non web-server
applications and non-tracing applications will see smaller
improvements.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>chore(deps): Bump <code>rrweb</code> to <code>2.35.0</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15825"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15825/hovercard">#15825</a>)</li>
<li>deps: Bump bundler plugins to <code>3.2.3</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15829"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15829/hovercard">#15829</a>)</li>
<li>feat: Always truncate stored breadcrumb messages to 2kb (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15819"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15819/hovercard">#15819</a>)</li>
<li>feat(nextjs): Disable server webpack-handling for static builds (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15751"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15751/hovercard">#15751</a>)</li>
<li>fix(nuxt): Don't override Nuxt options if undefined (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15795"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15795/hovercard">#15795</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.08 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>22.88 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.49 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.65 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.3 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.87 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.5 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>24.86 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.39 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.3 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.18 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.12 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.33 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.51 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.53 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.71 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>70.93 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.11 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.4 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.97 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.68 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.92 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.91 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.12 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.46 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmYjEwN2UyYy01YjQ3LTRlMzAtYWM2Ni1iN2NjNmM1NTFmNTAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZiMTA3ZTJjLTViNDctNGUzMC1hYzY2LWI3Y2M2YzU1MWY1MCJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.9.0","to":"9.10.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","prPublicId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3b48baaa-833b-4239-b348-16091472ee83","projectUrl":"https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-03-27T18:39:06.554Z"},"vulns":[]}'
## Podsumowanie wygenerowane przez Sourcery
Aktualizacja @sentry/browser z wersji 9.9.0 do 9.10.0, zawierająca nowe
funkcje i poprawki wydajności.
Nowe funkcje:
- Wprowadzono metody logowania z eksperymentalnym wsparciem logów
- Dodano możliwość łączenia poprzednich śladów (traces) w śledzeniu
przeglądarki (browser tracing)
Ulepszenia:
- Dodano wsparcie dla programowego diagnozowania problemów z łącznością
SDK
- Poprawiono wydajność dla Node SDK dzięki optymalizacjom śledzenia
(tracing optimizations)
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.9.0 to 9.10.0, incorporating new
features and performance improvements
New Features:
- Introduced logging methods with experimental log support
- Added ability to link previous traces in browser tracing
Enhancements:
- Added support for programmatically diagnosing SDK connectivity issues
- Improved performance for Node SDKs with tracing optimizations
</details>
Sign up for freeto 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.

Add previous_trace span link to browserTracingIntegration root spans

2 participants

@Lms24@s1gr1d
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' feat(browser): Add `previous_trace` span links by Lms24 · Pull Request #15569 · getsentry/sentry-javascript · GitHub
Skip to content

feat(browser): Add previous_trace span links - #15569

Merged
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links
Mar 21, 2025
Merged

feat(browser): Add previous_trace span links#15569
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links

Conversation

@Lms24

@Lms24Lms24 commented Mar 4, 2025

Copy link
Copy Markdown
Member

This PR adds logic to set the previous_trace span link on root spans (via browserTracingIntegration).

Some notes:

  • added linkPreviousTrace integration option to control the trace linking behaviour:
    • in-memory - default - previous trace data is linked and stored in memory
    • session-storage - previous trace data is linked and stored in session storage
    • off - no previous trace data is stored or linked
  • we can't yet sample on the previous trace in tracesSampler but this I'll tackle via Add option to sample linked traces consistently #15754
  • everything is implemented within browserTracingIntegration, meaning there's no bundle size hit for error-only users or users who only send manual spans (the latter is a tradeoff but I think it's a fair one)
  • added unit and integration tests for a bunch of scenarios

Happy to bike shed on the options naming :D

closes#14992

UPDATE: I rewrote the public API options from having two options (enablePreviousTrace and persistPreviousTrace) to only one which controls both aspects.

@github-actions

github-actionsBot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.28 KB--
@sentry/browser - with treeshaking flags23.09 KB--
@sentry/browser (incl. Tracing)36.6 KB+0.78%+287 B 🔺
@sentry/browser (incl. Tracing, Replay)73.79 KB+0.41%+305 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags67.14 KB+0.34%+231 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)78.42 KB+0.39%+307 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)90.99 KB+0.37%+338 B 🔺
@sentry/browser (incl. Feedback)40.41 KB--
@sentry/browser (incl. sendFeedback)27.91 KB--
@sentry/browser (incl. FeedbackAsync)32.71 KB--
@sentry/react25.07 KB--
@sentry/react (incl. Tracing)38.53 KB+0.76%+296 B 🔺
@sentry/vue27.5 KB--
@sentry/vue (incl. Tracing)38.3 KB+0.74%+288 B 🔺
@sentry/svelte23.31 KB--
CDN Bundle24.5 KB--
CDN Bundle (incl. Tracing)36.61 KB+0.67%+248 B 🔺
CDN Bundle (incl. Tracing, Replay)71.62 KB+0.33%+235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)76.82 KB+0.31%+236 B 🔺
CDN Bundle - uncompressed71.63 KB--
CDN Bundle (incl. Tracing) - uncompressed108.66 KB+0.62%+684 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed219.92 KB+0.31%+684 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed232.49 KB+0.29%+684 B 🔺
@sentry/nextjs (client)39.81 KB+0.73%+295 B 🔺
@sentry/sveltekit (client)37.03 KB+0.79%+294 B 🔺
@sentry/node142.63 KB--
@sentry/node - without tracing96.01 KB--
@sentry/aws-serverless120.38 KB--

View base workflow run

@Lms24Lms24 self-assigned this Mar 4, 2025
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 66ec822 to 45bc790CompareMarch 19, 2025 15:40
@Lms24
Lms24 marked this pull request as ready for review March 20, 2025 11:51
@Lms24
Lms24 requested review from mydea and s1gr1dMarch 20, 2025 11:51
Comment on lines +396 to +400
previousTraceInfo = addPreviousTraceSpanLink(previousTraceInfo, span);

if (persistPreviousTrace) {
storePreviousTraceInSessionStorage(previousTraceInfo);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think all this code around the previous trace can be put in here. Then there is also no need to mutate the variable or store undefined in a variable if persisting is turned off.

Suggested change
previousTraceInfo=addPreviousTraceSpanLink(previousTraceInfo,span);
if(persistPreviousTrace){
storePreviousTraceInSessionStorage(previousTraceInfo);
}
if(persistPreviousTrace){
constupdatedPreviousTraceInfo=addPreviousTraceSpanLink(
getPreviousTraceFromSessionStorage(),span
)
storePreviousTraceInSessionStorage(updatedPreviousTraceInfo);
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Happy to rewrite this but I still need to call addPreviousTraceSpanLink if persistPreviousTrace is false (as by default). Let me take another look

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I rewrote this a bit based on your suggestion as well as on unifying the two options. b44e790

Comment threadpackages/browser/src/tracing/previousTrace.ts
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 0550ac6 to 6c42afdCompareMarch 20, 2025 14:25
@Lms24
Lms24 requested a review from s1gr1dMarch 21, 2025 09:56

@s1gr1ds1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Such nice API 🥇

@Lms24
Lms24 merged commit 1a4fa0c into developMar 21, 2025
@Lms24
Lms24 deleted the lms/feat-previous-trace-links branch March 21, 2025 10:21
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 17, 2025
![snyk-io[bot]](https://badgen.net/badge/icon/snyk-io%5Bbot%5D/green?label=)
![Contributor](https://badgen.net/badge/icon/Contributor/000000?label=)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.7.0 to
9.9.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **24 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.8.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.8.0">2025-03-21</a></br><ul>
<li>feat(node): Implement new continuous profiling API spec (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15635"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15635/hovercard">#15635</a>)</li>
<li>feat(profiling): Add platform to chunk envelope (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15758"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15758/hovercard">#15758</a>)</li>
<li>feat(react): Export captureReactException method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15746"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15746/hovercard">#15746</a>)</li>
<li>fix(node): Check for <code>res.end</code> before passing to Proxy
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15776"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15776/hovercard">#15776</a>)</li>
<li>perf(core): Add short-circuits to <code>eventFilters</code>
integration (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15752"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15752/hovercard">#15752</a>)</li>
<li>perf(node): Short circuit flushing on Vercel only for Vercel (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15734"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15734/hovercard">#15734</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.29 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.11 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.51 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.15 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.43 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.73 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.1 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.26 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.53 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.04 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.33 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.52 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.38 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.41 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.61 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.68 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.06 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.32 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.88 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.56 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.76 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.65 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.04 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.41 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.7.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.7.0">2025-03-20</a></br><ul>
<li>feat(core): Add <code>captureLog</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15717"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15717/hovercard">#15717</a>)</li>
<li>feat(remix/cloudflare): Export <code>sentryHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15726"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15726/hovercard">#15726</a>)</li>
<li>fix(node): Always flush on Vercel before Lambda freeze (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15602"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15602/hovercard">#15602</a>)</li>
<li>fix(node): Ensure incoming traces are propagated without
HttpInstrumentation (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15732"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15732/hovercard">#15732</a>)</li>
<li>fix(node): Use <code>fatal</code> level for unhandled rejections in
<code>strict</code> mode (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15720"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15720/hovercard">#15720</a>)</li>
<li>fix(nuxt): Delete Nuxt server template injection (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15749"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15749/hovercard">#15749</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.28 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.09 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.33 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.5 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.93 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.13 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.69 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.7 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.08 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.23 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.02 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.3 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.49 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.37 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.57 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.56 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>107.94 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.2 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.77 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.52 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.73 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.62 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.01 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.37 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJjNzI0M2IxOS0yMmVlLTQ5NWItYWJhMS02YjJlOGVhY2FlYjYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImM3MjQzYjE5LTIyZWUtNDk1Yi1hYmExLTZiMmU4ZWFjYWViNiJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.7.0","to":"9.9.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","prPublicId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-03-24T13:46:37.750Z"},"vulns":[]}'
## Podsumowanie od Sourcery
Aktualizacja @sentry/browser z wersji 9.7.0 do 9.9.0
Ulepszenia:
- Dodano wsparcie dla instrumentacji po stronie klienta Next.js
- Wprowadzono możliwość łączenia poprzednich śladów (traces)
- Dodano metody loggera dla nadchodzącego produktu do logowania Sentry
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.7.0 to 9.9.0
Enhancements:
- Added support for Next.js client-side instrumentation
- Introduced ability to link previous traces
- Added logger methods for upcoming Sentry logging product
</details>
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 18, 2025
![reisene](https://badgen.net/badge/icon/reisene/green?label=) [<img
width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
<!--- SUMMARY_MARKER --->
## Sweep Summary <sub><a href="https://app.sweep.dev"><img
src="https://raw.githubusercontent.com/sweepai/sweep/main/.assets/sweep-square.png"
width="25" alt="Sweep"></a></sub>
Adds user registration functionality with email uniqueness validation
and password encoding to the HulajDusza service.
- Created `UserRegistrationDto` with validation annotations for email,
password, and name fields.
- Added `isEmailInUse` method to `UserService` to check if an email is
already registered.
- Implemented `registerUser` method in `UserServiceImpl` that creates a
new user with encoded password.
- Added `/api/users/register` endpoint in `UserController` that handles
user registration requests and returns appropriate HTTP responses.
---
[Ask Sweep AI questions about this PR](https://app.sweep.dev)
<!--- SUMMARY_MARKER --->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.9.0 to
9.10.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **22 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.10.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.10.0">2025-03-27</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat: Add support for logs</strong></p>
<ul>
<li>feat(node): Add logging public APIs to Node SDKs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15764"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15764/hovercard">#15764</a>)</li>
<li>feat(core): Add support for <code>beforeSendLog</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15814"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15814/hovercard">#15814</a>)</li>
<li>feat(core): Add support for parameterizing logs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15812"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15812/hovercard">#15812</a>)</li>
<li>fix: Remove critical log severity level (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15824"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15824/hovercard">#15824</a>)</li>
</ul>
<p>All JavaScript SDKs other than <code>@ sentry/cloudflare</code> and
<code>@ sentry/deno</code> now support sending logs via dedicated
methods as part of Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>.</p>
<p>Logging is gated by an experimental option,
<code>_experiments.enableLogs</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'PUBLIC_DSN',
// `enableLogs` must be set to true to use the logging features
_experiments: { enableLogs: true },
});
const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
trace('Starting database connection', { database: 'users' });
debug('Cache miss for user', { userId: 123 });
error('Failed to process payment', { orderId: 'order_123', amount: 99.99
});
fatal('Database connection pool exhausted', { database: 'users',
activeConnections: 100 });
// Structured logging via the `fmt` helper function. When you use `fmt`,
the string template and parameters are sent separately so they can be
queried independently in Sentry.
info(fmt(`Updated profile for user ${userId}`));
warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests:
${requests}, Limit: ${limit}`));"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'PUBLIC_DSN'</span><span class="pl-kos">,</span>
<span class="pl-c">// `enableLogs` must be set to true to use the
logging features</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> trace<span
class="pl-kos">,</span> debug<span class="pl-kos">,</span> info<span
class="pl-kos">,</span> warn<span class="pl-kos">,</span> error<span
class="pl-kos">,</span> fatal<span class="pl-kos">,</span> fmt <span
class="pl-kos">}</span> <span class="pl-c1">=</span> <span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">;</span>
<span class="pl-en">trace</span><span class="pl-kos">(</span><span
class="pl-s">'Starting database connection'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-en">debug</span><span class="pl-kos">(</span><span
class="pl-s">'Cache miss for user'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">userId</span>: <span
class="pl-c1">123</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">error</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to process payment'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">orderId</span>: <span class="pl-s">'order_123'</span><span
class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span
class="pl-c1">99.99</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">fatal</span><span class="pl-kos">(</span><span
class="pl-s">'Database connection pool exhausted'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span><span
class="pl-kos">,</span> <span class="pl-c1">activeConnections</span>:
<span class="pl-c1">100</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Structured logging via the `fmt` helper function.
When you use `fmt`, the string template and parameters are sent
separately so they can be queried independently in Sentry.</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Updated profile for user <span class="pl-s1"><span
class="pl-kos">${</span><span class="pl-s1">userId</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Rate limit approaching for endpoint <span
class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">endpoint</span><span class="pl-kos">}</span></span>.
Requests: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">requests</span><span class="pl-kos">}</span></span>,
Limit: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">limit</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p>With server-side SDKs like <code>@ sentry/node</code>, <code>@
sentry/bun</code> or server-side of <code>@ sentry/nextjs</code> or
<code>@ sentry/sveltekit</code>, you can do structured logging without
needing the <code>fmt</code> helper function.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const { info, warn }
= Sentry.logger;
info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404
});"><pre><span class="pl-k">const</span> <span class="pl-kos">{</span>
info<span class="pl-kos">,</span> warn <span class="pl-kos">}</span>
<span class="pl-c1">=</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-c1">logger</span><span
class="pl-kos">;</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'User %s logged in successfully'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to load user %s data'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">errorCode</span>: <span class="pl-c1">404</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>To filter logs, or update them before they are sent to Sentry, you
can use the <code>_experiments.beforeSendLog</code> option.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>diagnoseSdkConnectivity()</code>
function to programmatically detect possible connectivity issues (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15821"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15821/hovercard">#15821</a>)</strong></p>
<p>The <code>diagnoseSdkConnectivity()</code> function can be used to
programmatically detect possible connectivity issues with the Sentry
SDK.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const result = await
Sentry.diagnoseSdkConnectivity();"><pre><span class="pl-k">const</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span
class="pl-k">await</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span
class="pl-en">diagnoseSdkConnectivity</span><span
class="pl-kos">(</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>The result will be an object with the following properties:</p>
<ul>
<li><code>"no-client-active"</code>: There was no active client when the
function was called. This possibly means that the SDK was not
initialized yet.</li>
<li><code>"sentry-unreachable"</code>: The Sentry SaaS servers were not
reachable. This likely means that there is an ad blocker active on the
page or that there are other connection issues.</li>
<li><code>undefined</code>: The SDK is working as expected.</li>
</ul>
</li>
<li>
<p><strong>SDK Tracing Performance Improvements for Node
SDKs</strong></p>
<ul>
<li>feat: Stop using <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15796"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15796/hovercard">#15796</a>)</li>
<li>feat(node): Only add span listeners for instrumentation when used
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15802"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15802/hovercard">#15802</a>)</li>
<li>ref: Avoid <code>dropUndefinedKeys</code> for
<code>spanToJSON</code> calls (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15792"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15792/hovercard">#15792</a>)</li>
<li>ref: Avoid using <code>SentryError</code> for PromiseBuffer control
flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15822"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15822/hovercard">#15822</a>)</li>
<li>ref: Stop using <code>dropUndefinedKeys</code> in SpanExporter (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15794"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15794/hovercard">#15794</a>)</li>
<li>ref(core): Avoid using <code>SentryError</code> for event processing
control flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15823"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15823/hovercard">#15823</a>)</li>
<li>ref(node): Avoid <code>dropUndefinedKeys</code> in Node SDK init (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15797"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15797/hovercard">#15797</a>)</li>
<li>ref(opentelemetry): Avoid sampling work for non-root spans (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15820"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15820/hovercard">#15820</a>)</li>
</ul>
<p>We've been hard at work making performance improvements to the Sentry
Node SDKs (<code>@ sentry/node</code>, <code>@
sentry/aws-serverless</code>, <code>@ sentry/nestjs</code>, etc.). We've
seen that upgrading from <code>9.7.0</code> to <code>9.10.0</code> leads
to 30-40% improvement in request latency for HTTP web-server
applications that use tracing with high sample rates. Non web-server
applications and non-tracing applications will see smaller
improvements.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>chore(deps): Bump <code>rrweb</code> to <code>2.35.0</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15825"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15825/hovercard">#15825</a>)</li>
<li>deps: Bump bundler plugins to <code>3.2.3</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15829"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15829/hovercard">#15829</a>)</li>
<li>feat: Always truncate stored breadcrumb messages to 2kb (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15819"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15819/hovercard">#15819</a>)</li>
<li>feat(nextjs): Disable server webpack-handling for static builds (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15751"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15751/hovercard">#15751</a>)</li>
<li>fix(nuxt): Don't override Nuxt options if undefined (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15795"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15795/hovercard">#15795</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.08 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>22.88 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.49 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.65 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.3 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.87 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.5 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>24.86 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.39 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.3 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.18 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.12 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.33 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.51 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.53 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.71 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>70.93 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.11 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.4 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.97 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.68 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.92 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.91 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.12 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.46 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmYjEwN2UyYy01YjQ3LTRlMzAtYWM2Ni1iN2NjNmM1NTFmNTAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZiMTA3ZTJjLTViNDctNGUzMC1hYzY2LWI3Y2M2YzU1MWY1MCJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.9.0","to":"9.10.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","prPublicId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3b48baaa-833b-4239-b348-16091472ee83","projectUrl":"https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-03-27T18:39:06.554Z"},"vulns":[]}'
## Podsumowanie wygenerowane przez Sourcery
Aktualizacja @sentry/browser z wersji 9.9.0 do 9.10.0, zawierająca nowe
funkcje i poprawki wydajności.
Nowe funkcje:
- Wprowadzono metody logowania z eksperymentalnym wsparciem logów
- Dodano możliwość łączenia poprzednich śladów (traces) w śledzeniu
przeglądarki (browser tracing)
Ulepszenia:
- Dodano wsparcie dla programowego diagnozowania problemów z łącznością
SDK
- Poprawiono wydajność dla Node SDK dzięki optymalizacjom śledzenia
(tracing optimizations)
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.9.0 to 9.10.0, incorporating new
features and performance improvements
New Features:
- Introduced logging methods with experimental log support
- Added ability to link previous traces in browser tracing
Enhancements:
- Added support for programmatically diagnosing SDK connectivity issues
- Improved performance for Node SDKs with tracing optimizations
</details>
Sign up for freeto 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.

Add previous_trace span link to browserTracingIntegration root spans

2 participants

@Lms24@s1gr1d
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat(browser): Add `previous_trace` span links by Lms24 · Pull Request #15569 · getsentry/sentry-javascript · GitHub
Skip to content

feat(browser): Add previous_trace span links - #15569

Merged
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links
Mar 21, 2025
Merged

feat(browser): Add previous_trace span links#15569
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links

Conversation

@Lms24

@Lms24Lms24 commented Mar 4, 2025

Copy link
Copy Markdown
Member

This PR adds logic to set the previous_trace span link on root spans (via browserTracingIntegration).

Some notes:

  • added linkPreviousTrace integration option to control the trace linking behaviour:
    • in-memory - default - previous trace data is linked and stored in memory
    • session-storage - previous trace data is linked and stored in session storage
    • off - no previous trace data is stored or linked
  • we can't yet sample on the previous trace in tracesSampler but this I'll tackle via Add option to sample linked traces consistently #15754
  • everything is implemented within browserTracingIntegration, meaning there's no bundle size hit for error-only users or users who only send manual spans (the latter is a tradeoff but I think it's a fair one)
  • added unit and integration tests for a bunch of scenarios

Happy to bike shed on the options naming :D

closes#14992

UPDATE: I rewrote the public API options from having two options (enablePreviousTrace and persistPreviousTrace) to only one which controls both aspects.

@github-actions

github-actionsBot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.28 KB--
@sentry/browser - with treeshaking flags23.09 KB--
@sentry/browser (incl. Tracing)36.6 KB+0.78%+287 B 🔺
@sentry/browser (incl. Tracing, Replay)73.79 KB+0.41%+305 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags67.14 KB+0.34%+231 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)78.42 KB+0.39%+307 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)90.99 KB+0.37%+338 B 🔺
@sentry/browser (incl. Feedback)40.41 KB--
@sentry/browser (incl. sendFeedback)27.91 KB--
@sentry/browser (incl. FeedbackAsync)32.71 KB--
@sentry/react25.07 KB--
@sentry/react (incl. Tracing)38.53 KB+0.76%+296 B 🔺
@sentry/vue27.5 KB--
@sentry/vue (incl. Tracing)38.3 KB+0.74%+288 B 🔺
@sentry/svelte23.31 KB--
CDN Bundle24.5 KB--
CDN Bundle (incl. Tracing)36.61 KB+0.67%+248 B 🔺
CDN Bundle (incl. Tracing, Replay)71.62 KB+0.33%+235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)76.82 KB+0.31%+236 B 🔺
CDN Bundle - uncompressed71.63 KB--
CDN Bundle (incl. Tracing) - uncompressed108.66 KB+0.62%+684 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed219.92 KB+0.31%+684 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed232.49 KB+0.29%+684 B 🔺
@sentry/nextjs (client)39.81 KB+0.73%+295 B 🔺
@sentry/sveltekit (client)37.03 KB+0.79%+294 B 🔺
@sentry/node142.63 KB--
@sentry/node - without tracing96.01 KB--
@sentry/aws-serverless120.38 KB--

View base workflow run

@Lms24Lms24 self-assigned this Mar 4, 2025
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 66ec822 to 45bc790CompareMarch 19, 2025 15:40
@Lms24
Lms24 marked this pull request as ready for review March 20, 2025 11:51
@Lms24
Lms24 requested review from mydea and s1gr1dMarch 20, 2025 11:51
Comment on lines +396 to +400
previousTraceInfo = addPreviousTraceSpanLink(previousTraceInfo, span);

if (persistPreviousTrace) {
storePreviousTraceInSessionStorage(previousTraceInfo);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think all this code around the previous trace can be put in here. Then there is also no need to mutate the variable or store undefined in a variable if persisting is turned off.

Suggested change
previousTraceInfo=addPreviousTraceSpanLink(previousTraceInfo,span);
if(persistPreviousTrace){
storePreviousTraceInSessionStorage(previousTraceInfo);
}
if(persistPreviousTrace){
constupdatedPreviousTraceInfo=addPreviousTraceSpanLink(
getPreviousTraceFromSessionStorage(),span
)
storePreviousTraceInSessionStorage(updatedPreviousTraceInfo);
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Happy to rewrite this but I still need to call addPreviousTraceSpanLink if persistPreviousTrace is false (as by default). Let me take another look

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I rewrote this a bit based on your suggestion as well as on unifying the two options. b44e790

Comment threadpackages/browser/src/tracing/previousTrace.ts
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 0550ac6 to 6c42afdCompareMarch 20, 2025 14:25
@Lms24
Lms24 requested a review from s1gr1dMarch 21, 2025 09:56

@s1gr1ds1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Such nice API 🥇

@Lms24
Lms24 merged commit 1a4fa0c into developMar 21, 2025
@Lms24
Lms24 deleted the lms/feat-previous-trace-links branch March 21, 2025 10:21
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 17, 2025
![snyk-io[bot]](https://badgen.net/badge/icon/snyk-io%5Bbot%5D/green?label=)
![Contributor](https://badgen.net/badge/icon/Contributor/000000?label=)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.7.0 to
9.9.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **24 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.8.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.8.0">2025-03-21</a></br><ul>
<li>feat(node): Implement new continuous profiling API spec (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15635"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15635/hovercard">#15635</a>)</li>
<li>feat(profiling): Add platform to chunk envelope (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15758"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15758/hovercard">#15758</a>)</li>
<li>feat(react): Export captureReactException method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15746"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15746/hovercard">#15746</a>)</li>
<li>fix(node): Check for <code>res.end</code> before passing to Proxy
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15776"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15776/hovercard">#15776</a>)</li>
<li>perf(core): Add short-circuits to <code>eventFilters</code>
integration (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15752"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15752/hovercard">#15752</a>)</li>
<li>perf(node): Short circuit flushing on Vercel only for Vercel (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15734"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15734/hovercard">#15734</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.29 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.11 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.51 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.15 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.43 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.73 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.1 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.26 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.53 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.04 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.33 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.52 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.38 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.41 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.61 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.68 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.06 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.32 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.88 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.56 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.76 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.65 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.04 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.41 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.7.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.7.0">2025-03-20</a></br><ul>
<li>feat(core): Add <code>captureLog</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15717"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15717/hovercard">#15717</a>)</li>
<li>feat(remix/cloudflare): Export <code>sentryHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15726"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15726/hovercard">#15726</a>)</li>
<li>fix(node): Always flush on Vercel before Lambda freeze (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15602"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15602/hovercard">#15602</a>)</li>
<li>fix(node): Ensure incoming traces are propagated without
HttpInstrumentation (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15732"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15732/hovercard">#15732</a>)</li>
<li>fix(node): Use <code>fatal</code> level for unhandled rejections in
<code>strict</code> mode (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15720"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15720/hovercard">#15720</a>)</li>
<li>fix(nuxt): Delete Nuxt server template injection (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15749"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15749/hovercard">#15749</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.28 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.09 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.33 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.5 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.93 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.13 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.69 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.7 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.08 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.23 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.02 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.3 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.49 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.37 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.57 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.56 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>107.94 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.2 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.77 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.52 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.73 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.62 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.01 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.37 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJjNzI0M2IxOS0yMmVlLTQ5NWItYWJhMS02YjJlOGVhY2FlYjYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImM3MjQzYjE5LTIyZWUtNDk1Yi1hYmExLTZiMmU4ZWFjYWViNiJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.7.0","to":"9.9.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","prPublicId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-03-24T13:46:37.750Z"},"vulns":[]}'
## Podsumowanie od Sourcery
Aktualizacja @sentry/browser z wersji 9.7.0 do 9.9.0
Ulepszenia:
- Dodano wsparcie dla instrumentacji po stronie klienta Next.js
- Wprowadzono możliwość łączenia poprzednich śladów (traces)
- Dodano metody loggera dla nadchodzącego produktu do logowania Sentry
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.7.0 to 9.9.0
Enhancements:
- Added support for Next.js client-side instrumentation
- Introduced ability to link previous traces
- Added logger methods for upcoming Sentry logging product
</details>
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 18, 2025
![reisene](https://badgen.net/badge/icon/reisene/green?label=) [<img
width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
<!--- SUMMARY_MARKER --->
## Sweep Summary <sub><a href="https://app.sweep.dev"><img
src="https://raw.githubusercontent.com/sweepai/sweep/main/.assets/sweep-square.png"
width="25" alt="Sweep"></a></sub>
Adds user registration functionality with email uniqueness validation
and password encoding to the HulajDusza service.
- Created `UserRegistrationDto` with validation annotations for email,
password, and name fields.
- Added `isEmailInUse` method to `UserService` to check if an email is
already registered.
- Implemented `registerUser` method in `UserServiceImpl` that creates a
new user with encoded password.
- Added `/api/users/register` endpoint in `UserController` that handles
user registration requests and returns appropriate HTTP responses.
---
[Ask Sweep AI questions about this PR](https://app.sweep.dev)
<!--- SUMMARY_MARKER --->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.9.0 to
9.10.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **22 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.10.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.10.0">2025-03-27</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat: Add support for logs</strong></p>
<ul>
<li>feat(node): Add logging public APIs to Node SDKs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15764"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15764/hovercard">#15764</a>)</li>
<li>feat(core): Add support for <code>beforeSendLog</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15814"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15814/hovercard">#15814</a>)</li>
<li>feat(core): Add support for parameterizing logs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15812"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15812/hovercard">#15812</a>)</li>
<li>fix: Remove critical log severity level (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15824"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15824/hovercard">#15824</a>)</li>
</ul>
<p>All JavaScript SDKs other than <code>@ sentry/cloudflare</code> and
<code>@ sentry/deno</code> now support sending logs via dedicated
methods as part of Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>.</p>
<p>Logging is gated by an experimental option,
<code>_experiments.enableLogs</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'PUBLIC_DSN',
// `enableLogs` must be set to true to use the logging features
_experiments: { enableLogs: true },
});
const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
trace('Starting database connection', { database: 'users' });
debug('Cache miss for user', { userId: 123 });
error('Failed to process payment', { orderId: 'order_123', amount: 99.99
});
fatal('Database connection pool exhausted', { database: 'users',
activeConnections: 100 });
// Structured logging via the `fmt` helper function. When you use `fmt`,
the string template and parameters are sent separately so they can be
queried independently in Sentry.
info(fmt(`Updated profile for user ${userId}`));
warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests:
${requests}, Limit: ${limit}`));"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'PUBLIC_DSN'</span><span class="pl-kos">,</span>
<span class="pl-c">// `enableLogs` must be set to true to use the
logging features</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> trace<span
class="pl-kos">,</span> debug<span class="pl-kos">,</span> info<span
class="pl-kos">,</span> warn<span class="pl-kos">,</span> error<span
class="pl-kos">,</span> fatal<span class="pl-kos">,</span> fmt <span
class="pl-kos">}</span> <span class="pl-c1">=</span> <span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">;</span>
<span class="pl-en">trace</span><span class="pl-kos">(</span><span
class="pl-s">'Starting database connection'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-en">debug</span><span class="pl-kos">(</span><span
class="pl-s">'Cache miss for user'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">userId</span>: <span
class="pl-c1">123</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">error</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to process payment'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">orderId</span>: <span class="pl-s">'order_123'</span><span
class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span
class="pl-c1">99.99</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">fatal</span><span class="pl-kos">(</span><span
class="pl-s">'Database connection pool exhausted'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span><span
class="pl-kos">,</span> <span class="pl-c1">activeConnections</span>:
<span class="pl-c1">100</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Structured logging via the `fmt` helper function.
When you use `fmt`, the string template and parameters are sent
separately so they can be queried independently in Sentry.</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Updated profile for user <span class="pl-s1"><span
class="pl-kos">${</span><span class="pl-s1">userId</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Rate limit approaching for endpoint <span
class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">endpoint</span><span class="pl-kos">}</span></span>.
Requests: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">requests</span><span class="pl-kos">}</span></span>,
Limit: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">limit</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p>With server-side SDKs like <code>@ sentry/node</code>, <code>@
sentry/bun</code> or server-side of <code>@ sentry/nextjs</code> or
<code>@ sentry/sveltekit</code>, you can do structured logging without
needing the <code>fmt</code> helper function.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const { info, warn }
= Sentry.logger;
info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404
});"><pre><span class="pl-k">const</span> <span class="pl-kos">{</span>
info<span class="pl-kos">,</span> warn <span class="pl-kos">}</span>
<span class="pl-c1">=</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-c1">logger</span><span
class="pl-kos">;</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'User %s logged in successfully'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to load user %s data'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">errorCode</span>: <span class="pl-c1">404</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>To filter logs, or update them before they are sent to Sentry, you
can use the <code>_experiments.beforeSendLog</code> option.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>diagnoseSdkConnectivity()</code>
function to programmatically detect possible connectivity issues (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15821"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15821/hovercard">#15821</a>)</strong></p>
<p>The <code>diagnoseSdkConnectivity()</code> function can be used to
programmatically detect possible connectivity issues with the Sentry
SDK.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const result = await
Sentry.diagnoseSdkConnectivity();"><pre><span class="pl-k">const</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span
class="pl-k">await</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span
class="pl-en">diagnoseSdkConnectivity</span><span
class="pl-kos">(</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>The result will be an object with the following properties:</p>
<ul>
<li><code>"no-client-active"</code>: There was no active client when the
function was called. This possibly means that the SDK was not
initialized yet.</li>
<li><code>"sentry-unreachable"</code>: The Sentry SaaS servers were not
reachable. This likely means that there is an ad blocker active on the
page or that there are other connection issues.</li>
<li><code>undefined</code>: The SDK is working as expected.</li>
</ul>
</li>
<li>
<p><strong>SDK Tracing Performance Improvements for Node
SDKs</strong></p>
<ul>
<li>feat: Stop using <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15796"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15796/hovercard">#15796</a>)</li>
<li>feat(node): Only add span listeners for instrumentation when used
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15802"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15802/hovercard">#15802</a>)</li>
<li>ref: Avoid <code>dropUndefinedKeys</code> for
<code>spanToJSON</code> calls (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15792"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15792/hovercard">#15792</a>)</li>
<li>ref: Avoid using <code>SentryError</code> for PromiseBuffer control
flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15822"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15822/hovercard">#15822</a>)</li>
<li>ref: Stop using <code>dropUndefinedKeys</code> in SpanExporter (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15794"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15794/hovercard">#15794</a>)</li>
<li>ref(core): Avoid using <code>SentryError</code> for event processing
control flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15823"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15823/hovercard">#15823</a>)</li>
<li>ref(node): Avoid <code>dropUndefinedKeys</code> in Node SDK init (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15797"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15797/hovercard">#15797</a>)</li>
<li>ref(opentelemetry): Avoid sampling work for non-root spans (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15820"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15820/hovercard">#15820</a>)</li>
</ul>
<p>We've been hard at work making performance improvements to the Sentry
Node SDKs (<code>@ sentry/node</code>, <code>@
sentry/aws-serverless</code>, <code>@ sentry/nestjs</code>, etc.). We've
seen that upgrading from <code>9.7.0</code> to <code>9.10.0</code> leads
to 30-40% improvement in request latency for HTTP web-server
applications that use tracing with high sample rates. Non web-server
applications and non-tracing applications will see smaller
improvements.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>chore(deps): Bump <code>rrweb</code> to <code>2.35.0</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15825"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15825/hovercard">#15825</a>)</li>
<li>deps: Bump bundler plugins to <code>3.2.3</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15829"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15829/hovercard">#15829</a>)</li>
<li>feat: Always truncate stored breadcrumb messages to 2kb (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15819"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15819/hovercard">#15819</a>)</li>
<li>feat(nextjs): Disable server webpack-handling for static builds (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15751"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15751/hovercard">#15751</a>)</li>
<li>fix(nuxt): Don't override Nuxt options if undefined (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15795"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15795/hovercard">#15795</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.08 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>22.88 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.49 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.65 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.3 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.87 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.5 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>24.86 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.39 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.3 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.18 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.12 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.33 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.51 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.53 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.71 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>70.93 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.11 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.4 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.97 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.68 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.92 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.91 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.12 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.46 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmYjEwN2UyYy01YjQ3LTRlMzAtYWM2Ni1iN2NjNmM1NTFmNTAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZiMTA3ZTJjLTViNDctNGUzMC1hYzY2LWI3Y2M2YzU1MWY1MCJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.9.0","to":"9.10.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","prPublicId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3b48baaa-833b-4239-b348-16091472ee83","projectUrl":"https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-03-27T18:39:06.554Z"},"vulns":[]}'
## Podsumowanie wygenerowane przez Sourcery
Aktualizacja @sentry/browser z wersji 9.9.0 do 9.10.0, zawierająca nowe
funkcje i poprawki wydajności.
Nowe funkcje:
- Wprowadzono metody logowania z eksperymentalnym wsparciem logów
- Dodano możliwość łączenia poprzednich śladów (traces) w śledzeniu
przeglądarki (browser tracing)
Ulepszenia:
- Dodano wsparcie dla programowego diagnozowania problemów z łącznością
SDK
- Poprawiono wydajność dla Node SDK dzięki optymalizacjom śledzenia
(tracing optimizations)
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.9.0 to 9.10.0, incorporating new
features and performance improvements
New Features:
- Introduced logging methods with experimental log support
- Added ability to link previous traces in browser tracing
Enhancements:
- Added support for programmatically diagnosing SDK connectivity issues
- Improved performance for Node SDKs with tracing optimizations
</details>
Sign up for freeto 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.

Add previous_trace span link to browserTracingIntegration root spans

2 participants

@Lms24@s1gr1d
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' feat(browser): Add `previous_trace` span links by Lms24 · Pull Request #15569 · getsentry/sentry-javascript · GitHub
Skip to content

feat(browser): Add previous_trace span links - #15569

Merged
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links
Mar 21, 2025
Merged

feat(browser): Add previous_trace span links#15569
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links

Conversation

@Lms24

@Lms24Lms24 commented Mar 4, 2025

Copy link
Copy Markdown
Member

This PR adds logic to set the previous_trace span link on root spans (via browserTracingIntegration).

Some notes:

  • added linkPreviousTrace integration option to control the trace linking behaviour:
    • in-memory - default - previous trace data is linked and stored in memory
    • session-storage - previous trace data is linked and stored in session storage
    • off - no previous trace data is stored or linked
  • we can't yet sample on the previous trace in tracesSampler but this I'll tackle via Add option to sample linked traces consistently #15754
  • everything is implemented within browserTracingIntegration, meaning there's no bundle size hit for error-only users or users who only send manual spans (the latter is a tradeoff but I think it's a fair one)
  • added unit and integration tests for a bunch of scenarios

Happy to bike shed on the options naming :D

closes#14992

UPDATE: I rewrote the public API options from having two options (enablePreviousTrace and persistPreviousTrace) to only one which controls both aspects.

@github-actions

github-actionsBot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.28 KB--
@sentry/browser - with treeshaking flags23.09 KB--
@sentry/browser (incl. Tracing)36.6 KB+0.78%+287 B 🔺
@sentry/browser (incl. Tracing, Replay)73.79 KB+0.41%+305 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags67.14 KB+0.34%+231 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)78.42 KB+0.39%+307 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)90.99 KB+0.37%+338 B 🔺
@sentry/browser (incl. Feedback)40.41 KB--
@sentry/browser (incl. sendFeedback)27.91 KB--
@sentry/browser (incl. FeedbackAsync)32.71 KB--
@sentry/react25.07 KB--
@sentry/react (incl. Tracing)38.53 KB+0.76%+296 B 🔺
@sentry/vue27.5 KB--
@sentry/vue (incl. Tracing)38.3 KB+0.74%+288 B 🔺
@sentry/svelte23.31 KB--
CDN Bundle24.5 KB--
CDN Bundle (incl. Tracing)36.61 KB+0.67%+248 B 🔺
CDN Bundle (incl. Tracing, Replay)71.62 KB+0.33%+235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)76.82 KB+0.31%+236 B 🔺
CDN Bundle - uncompressed71.63 KB--
CDN Bundle (incl. Tracing) - uncompressed108.66 KB+0.62%+684 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed219.92 KB+0.31%+684 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed232.49 KB+0.29%+684 B 🔺
@sentry/nextjs (client)39.81 KB+0.73%+295 B 🔺
@sentry/sveltekit (client)37.03 KB+0.79%+294 B 🔺
@sentry/node142.63 KB--
@sentry/node - without tracing96.01 KB--
@sentry/aws-serverless120.38 KB--

View base workflow run

@Lms24Lms24 self-assigned this Mar 4, 2025
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 66ec822 to 45bc790CompareMarch 19, 2025 15:40
@Lms24
Lms24 marked this pull request as ready for review March 20, 2025 11:51
@Lms24
Lms24 requested review from mydea and s1gr1dMarch 20, 2025 11:51
Comment on lines +396 to +400
previousTraceInfo = addPreviousTraceSpanLink(previousTraceInfo, span);

if (persistPreviousTrace) {
storePreviousTraceInSessionStorage(previousTraceInfo);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think all this code around the previous trace can be put in here. Then there is also no need to mutate the variable or store undefined in a variable if persisting is turned off.

Suggested change
previousTraceInfo=addPreviousTraceSpanLink(previousTraceInfo,span);
if(persistPreviousTrace){
storePreviousTraceInSessionStorage(previousTraceInfo);
}
if(persistPreviousTrace){
constupdatedPreviousTraceInfo=addPreviousTraceSpanLink(
getPreviousTraceFromSessionStorage(),span
)
storePreviousTraceInSessionStorage(updatedPreviousTraceInfo);
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Happy to rewrite this but I still need to call addPreviousTraceSpanLink if persistPreviousTrace is false (as by default). Let me take another look

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I rewrote this a bit based on your suggestion as well as on unifying the two options. b44e790

Comment threadpackages/browser/src/tracing/previousTrace.ts
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 0550ac6 to 6c42afdCompareMarch 20, 2025 14:25
@Lms24
Lms24 requested a review from s1gr1dMarch 21, 2025 09:56

@s1gr1ds1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Such nice API 🥇

@Lms24
Lms24 merged commit 1a4fa0c into developMar 21, 2025
@Lms24
Lms24 deleted the lms/feat-previous-trace-links branch March 21, 2025 10:21
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 17, 2025
![snyk-io[bot]](https://badgen.net/badge/icon/snyk-io%5Bbot%5D/green?label=)
![Contributor](https://badgen.net/badge/icon/Contributor/000000?label=)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.7.0 to
9.9.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **24 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.8.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.8.0">2025-03-21</a></br><ul>
<li>feat(node): Implement new continuous profiling API spec (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15635"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15635/hovercard">#15635</a>)</li>
<li>feat(profiling): Add platform to chunk envelope (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15758"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15758/hovercard">#15758</a>)</li>
<li>feat(react): Export captureReactException method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15746"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15746/hovercard">#15746</a>)</li>
<li>fix(node): Check for <code>res.end</code> before passing to Proxy
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15776"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15776/hovercard">#15776</a>)</li>
<li>perf(core): Add short-circuits to <code>eventFilters</code>
integration (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15752"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15752/hovercard">#15752</a>)</li>
<li>perf(node): Short circuit flushing on Vercel only for Vercel (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15734"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15734/hovercard">#15734</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.29 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.11 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.51 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.15 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.43 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.73 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.1 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.26 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.53 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.04 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.33 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.52 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.38 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.41 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.61 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.68 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.06 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.32 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.88 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.56 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.76 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.65 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.04 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.41 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.7.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.7.0">2025-03-20</a></br><ul>
<li>feat(core): Add <code>captureLog</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15717"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15717/hovercard">#15717</a>)</li>
<li>feat(remix/cloudflare): Export <code>sentryHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15726"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15726/hovercard">#15726</a>)</li>
<li>fix(node): Always flush on Vercel before Lambda freeze (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15602"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15602/hovercard">#15602</a>)</li>
<li>fix(node): Ensure incoming traces are propagated without
HttpInstrumentation (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15732"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15732/hovercard">#15732</a>)</li>
<li>fix(node): Use <code>fatal</code> level for unhandled rejections in
<code>strict</code> mode (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15720"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15720/hovercard">#15720</a>)</li>
<li>fix(nuxt): Delete Nuxt server template injection (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15749"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15749/hovercard">#15749</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.28 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.09 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.33 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.5 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.93 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.13 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.69 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.7 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.08 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.23 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.02 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.3 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.49 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.37 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.57 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.56 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>107.94 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.2 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.77 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.52 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.73 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.62 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.01 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.37 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJjNzI0M2IxOS0yMmVlLTQ5NWItYWJhMS02YjJlOGVhY2FlYjYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImM3MjQzYjE5LTIyZWUtNDk1Yi1hYmExLTZiMmU4ZWFjYWViNiJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.7.0","to":"9.9.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","prPublicId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-03-24T13:46:37.750Z"},"vulns":[]}'
## Podsumowanie od Sourcery
Aktualizacja @sentry/browser z wersji 9.7.0 do 9.9.0
Ulepszenia:
- Dodano wsparcie dla instrumentacji po stronie klienta Next.js
- Wprowadzono możliwość łączenia poprzednich śladów (traces)
- Dodano metody loggera dla nadchodzącego produktu do logowania Sentry
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.7.0 to 9.9.0
Enhancements:
- Added support for Next.js client-side instrumentation
- Introduced ability to link previous traces
- Added logger methods for upcoming Sentry logging product
</details>
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 18, 2025
![reisene](https://badgen.net/badge/icon/reisene/green?label=) [<img
width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
<!--- SUMMARY_MARKER --->
## Sweep Summary <sub><a href="https://app.sweep.dev"><img
src="https://raw.githubusercontent.com/sweepai/sweep/main/.assets/sweep-square.png"
width="25" alt="Sweep"></a></sub>
Adds user registration functionality with email uniqueness validation
and password encoding to the HulajDusza service.
- Created `UserRegistrationDto` with validation annotations for email,
password, and name fields.
- Added `isEmailInUse` method to `UserService` to check if an email is
already registered.
- Implemented `registerUser` method in `UserServiceImpl` that creates a
new user with encoded password.
- Added `/api/users/register` endpoint in `UserController` that handles
user registration requests and returns appropriate HTTP responses.
---
[Ask Sweep AI questions about this PR](https://app.sweep.dev)
<!--- SUMMARY_MARKER --->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.9.0 to
9.10.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **22 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.10.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.10.0">2025-03-27</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat: Add support for logs</strong></p>
<ul>
<li>feat(node): Add logging public APIs to Node SDKs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15764"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15764/hovercard">#15764</a>)</li>
<li>feat(core): Add support for <code>beforeSendLog</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15814"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15814/hovercard">#15814</a>)</li>
<li>feat(core): Add support for parameterizing logs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15812"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15812/hovercard">#15812</a>)</li>
<li>fix: Remove critical log severity level (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15824"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15824/hovercard">#15824</a>)</li>
</ul>
<p>All JavaScript SDKs other than <code>@ sentry/cloudflare</code> and
<code>@ sentry/deno</code> now support sending logs via dedicated
methods as part of Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>.</p>
<p>Logging is gated by an experimental option,
<code>_experiments.enableLogs</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'PUBLIC_DSN',
// `enableLogs` must be set to true to use the logging features
_experiments: { enableLogs: true },
});
const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
trace('Starting database connection', { database: 'users' });
debug('Cache miss for user', { userId: 123 });
error('Failed to process payment', { orderId: 'order_123', amount: 99.99
});
fatal('Database connection pool exhausted', { database: 'users',
activeConnections: 100 });
// Structured logging via the `fmt` helper function. When you use `fmt`,
the string template and parameters are sent separately so they can be
queried independently in Sentry.
info(fmt(`Updated profile for user ${userId}`));
warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests:
${requests}, Limit: ${limit}`));"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'PUBLIC_DSN'</span><span class="pl-kos">,</span>
<span class="pl-c">// `enableLogs` must be set to true to use the
logging features</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> trace<span
class="pl-kos">,</span> debug<span class="pl-kos">,</span> info<span
class="pl-kos">,</span> warn<span class="pl-kos">,</span> error<span
class="pl-kos">,</span> fatal<span class="pl-kos">,</span> fmt <span
class="pl-kos">}</span> <span class="pl-c1">=</span> <span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">;</span>
<span class="pl-en">trace</span><span class="pl-kos">(</span><span
class="pl-s">'Starting database connection'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-en">debug</span><span class="pl-kos">(</span><span
class="pl-s">'Cache miss for user'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">userId</span>: <span
class="pl-c1">123</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">error</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to process payment'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">orderId</span>: <span class="pl-s">'order_123'</span><span
class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span
class="pl-c1">99.99</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">fatal</span><span class="pl-kos">(</span><span
class="pl-s">'Database connection pool exhausted'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span><span
class="pl-kos">,</span> <span class="pl-c1">activeConnections</span>:
<span class="pl-c1">100</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Structured logging via the `fmt` helper function.
When you use `fmt`, the string template and parameters are sent
separately so they can be queried independently in Sentry.</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Updated profile for user <span class="pl-s1"><span
class="pl-kos">${</span><span class="pl-s1">userId</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Rate limit approaching for endpoint <span
class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">endpoint</span><span class="pl-kos">}</span></span>.
Requests: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">requests</span><span class="pl-kos">}</span></span>,
Limit: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">limit</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p>With server-side SDKs like <code>@ sentry/node</code>, <code>@
sentry/bun</code> or server-side of <code>@ sentry/nextjs</code> or
<code>@ sentry/sveltekit</code>, you can do structured logging without
needing the <code>fmt</code> helper function.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const { info, warn }
= Sentry.logger;
info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404
});"><pre><span class="pl-k">const</span> <span class="pl-kos">{</span>
info<span class="pl-kos">,</span> warn <span class="pl-kos">}</span>
<span class="pl-c1">=</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-c1">logger</span><span
class="pl-kos">;</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'User %s logged in successfully'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to load user %s data'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">errorCode</span>: <span class="pl-c1">404</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>To filter logs, or update them before they are sent to Sentry, you
can use the <code>_experiments.beforeSendLog</code> option.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>diagnoseSdkConnectivity()</code>
function to programmatically detect possible connectivity issues (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15821"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15821/hovercard">#15821</a>)</strong></p>
<p>The <code>diagnoseSdkConnectivity()</code> function can be used to
programmatically detect possible connectivity issues with the Sentry
SDK.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const result = await
Sentry.diagnoseSdkConnectivity();"><pre><span class="pl-k">const</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span
class="pl-k">await</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span
class="pl-en">diagnoseSdkConnectivity</span><span
class="pl-kos">(</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>The result will be an object with the following properties:</p>
<ul>
<li><code>"no-client-active"</code>: There was no active client when the
function was called. This possibly means that the SDK was not
initialized yet.</li>
<li><code>"sentry-unreachable"</code>: The Sentry SaaS servers were not
reachable. This likely means that there is an ad blocker active on the
page or that there are other connection issues.</li>
<li><code>undefined</code>: The SDK is working as expected.</li>
</ul>
</li>
<li>
<p><strong>SDK Tracing Performance Improvements for Node
SDKs</strong></p>
<ul>
<li>feat: Stop using <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15796"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15796/hovercard">#15796</a>)</li>
<li>feat(node): Only add span listeners for instrumentation when used
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15802"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15802/hovercard">#15802</a>)</li>
<li>ref: Avoid <code>dropUndefinedKeys</code> for
<code>spanToJSON</code> calls (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15792"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15792/hovercard">#15792</a>)</li>
<li>ref: Avoid using <code>SentryError</code> for PromiseBuffer control
flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15822"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15822/hovercard">#15822</a>)</li>
<li>ref: Stop using <code>dropUndefinedKeys</code> in SpanExporter (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15794"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15794/hovercard">#15794</a>)</li>
<li>ref(core): Avoid using <code>SentryError</code> for event processing
control flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15823"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15823/hovercard">#15823</a>)</li>
<li>ref(node): Avoid <code>dropUndefinedKeys</code> in Node SDK init (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15797"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15797/hovercard">#15797</a>)</li>
<li>ref(opentelemetry): Avoid sampling work for non-root spans (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15820"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15820/hovercard">#15820</a>)</li>
</ul>
<p>We've been hard at work making performance improvements to the Sentry
Node SDKs (<code>@ sentry/node</code>, <code>@
sentry/aws-serverless</code>, <code>@ sentry/nestjs</code>, etc.). We've
seen that upgrading from <code>9.7.0</code> to <code>9.10.0</code> leads
to 30-40% improvement in request latency for HTTP web-server
applications that use tracing with high sample rates. Non web-server
applications and non-tracing applications will see smaller
improvements.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>chore(deps): Bump <code>rrweb</code> to <code>2.35.0</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15825"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15825/hovercard">#15825</a>)</li>
<li>deps: Bump bundler plugins to <code>3.2.3</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15829"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15829/hovercard">#15829</a>)</li>
<li>feat: Always truncate stored breadcrumb messages to 2kb (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15819"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15819/hovercard">#15819</a>)</li>
<li>feat(nextjs): Disable server webpack-handling for static builds (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15751"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15751/hovercard">#15751</a>)</li>
<li>fix(nuxt): Don't override Nuxt options if undefined (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15795"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15795/hovercard">#15795</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.08 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>22.88 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.49 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.65 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.3 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.87 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.5 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>24.86 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.39 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.3 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.18 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.12 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.33 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.51 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.53 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.71 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>70.93 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.11 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.4 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.97 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.68 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.92 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.91 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.12 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.46 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmYjEwN2UyYy01YjQ3LTRlMzAtYWM2Ni1iN2NjNmM1NTFmNTAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZiMTA3ZTJjLTViNDctNGUzMC1hYzY2LWI3Y2M2YzU1MWY1MCJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.9.0","to":"9.10.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","prPublicId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3b48baaa-833b-4239-b348-16091472ee83","projectUrl":"https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-03-27T18:39:06.554Z"},"vulns":[]}'
## Podsumowanie wygenerowane przez Sourcery
Aktualizacja @sentry/browser z wersji 9.9.0 do 9.10.0, zawierająca nowe
funkcje i poprawki wydajności.
Nowe funkcje:
- Wprowadzono metody logowania z eksperymentalnym wsparciem logów
- Dodano możliwość łączenia poprzednich śladów (traces) w śledzeniu
przeglądarki (browser tracing)
Ulepszenia:
- Dodano wsparcie dla programowego diagnozowania problemów z łącznością
SDK
- Poprawiono wydajność dla Node SDK dzięki optymalizacjom śledzenia
(tracing optimizations)
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.9.0 to 9.10.0, incorporating new
features and performance improvements
New Features:
- Introduced logging methods with experimental log support
- Added ability to link previous traces in browser tracing
Enhancements:
- Added support for programmatically diagnosing SDK connectivity issues
- Improved performance for Node SDKs with tracing optimizations
</details>
Sign up for freeto 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.

Add previous_trace span link to browserTracingIntegration root spans

2 participants

@Lms24@s1gr1d
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); feat(browser): Add `previous_trace` span links by Lms24 · Pull Request #15569 · getsentry/sentry-javascript · GitHub
Skip to content

feat(browser): Add previous_trace span links - #15569

Merged
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links
Mar 21, 2025
Merged

feat(browser): Add previous_trace span links#15569
Lms24 merged 15 commits into
developfrom
lms/feat-previous-trace-links

Conversation

@Lms24

@Lms24Lms24 commented Mar 4, 2025

Copy link
Copy Markdown
Member

This PR adds logic to set the previous_trace span link on root spans (via browserTracingIntegration).

Some notes:

  • added linkPreviousTrace integration option to control the trace linking behaviour:
    • in-memory - default - previous trace data is linked and stored in memory
    • session-storage - previous trace data is linked and stored in session storage
    • off - no previous trace data is stored or linked
  • we can't yet sample on the previous trace in tracesSampler but this I'll tackle via Add option to sample linked traces consistently #15754
  • everything is implemented within browserTracingIntegration, meaning there's no bundle size hit for error-only users or users who only send manual spans (the latter is a tradeoff but I think it's a fair one)
  • added unit and integration tests for a bunch of scenarios

Happy to bike shed on the options naming :D

closes#14992

UPDATE: I rewrote the public API options from having two options (enablePreviousTrace and persistPreviousTrace) to only one which controls both aspects.

@github-actions

github-actionsBot commented Mar 4, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser23.28 KB--
@sentry/browser - with treeshaking flags23.09 KB--
@sentry/browser (incl. Tracing)36.6 KB+0.78%+287 B 🔺
@sentry/browser (incl. Tracing, Replay)73.79 KB+0.41%+305 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags67.14 KB+0.34%+231 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)78.42 KB+0.39%+307 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)90.99 KB+0.37%+338 B 🔺
@sentry/browser (incl. Feedback)40.41 KB--
@sentry/browser (incl. sendFeedback)27.91 KB--
@sentry/browser (incl. FeedbackAsync)32.71 KB--
@sentry/react25.07 KB--
@sentry/react (incl. Tracing)38.53 KB+0.76%+296 B 🔺
@sentry/vue27.5 KB--
@sentry/vue (incl. Tracing)38.3 KB+0.74%+288 B 🔺
@sentry/svelte23.31 KB--
CDN Bundle24.5 KB--
CDN Bundle (incl. Tracing)36.61 KB+0.67%+248 B 🔺
CDN Bundle (incl. Tracing, Replay)71.62 KB+0.33%+235 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)76.82 KB+0.31%+236 B 🔺
CDN Bundle - uncompressed71.63 KB--
CDN Bundle (incl. Tracing) - uncompressed108.66 KB+0.62%+684 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed219.92 KB+0.31%+684 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed232.49 KB+0.29%+684 B 🔺
@sentry/nextjs (client)39.81 KB+0.73%+295 B 🔺
@sentry/sveltekit (client)37.03 KB+0.79%+294 B 🔺
@sentry/node142.63 KB--
@sentry/node - without tracing96.01 KB--
@sentry/aws-serverless120.38 KB--

View base workflow run

@Lms24Lms24 self-assigned this Mar 4, 2025
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 66ec822 to 45bc790CompareMarch 19, 2025 15:40
@Lms24
Lms24 marked this pull request as ready for review March 20, 2025 11:51
@Lms24
Lms24 requested review from mydea and s1gr1dMarch 20, 2025 11:51
Comment on lines +396 to +400
previousTraceInfo = addPreviousTraceSpanLink(previousTraceInfo, span);

if (persistPreviousTrace) {
storePreviousTraceInSessionStorage(previousTraceInfo);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think all this code around the previous trace can be put in here. Then there is also no need to mutate the variable or store undefined in a variable if persisting is turned off.

Suggested change
previousTraceInfo=addPreviousTraceSpanLink(previousTraceInfo,span);
if(persistPreviousTrace){
storePreviousTraceInSessionStorage(previousTraceInfo);
}
if(persistPreviousTrace){
constupdatedPreviousTraceInfo=addPreviousTraceSpanLink(
getPreviousTraceFromSessionStorage(),span
)
storePreviousTraceInSessionStorage(updatedPreviousTraceInfo);
}

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Happy to rewrite this but I still need to call addPreviousTraceSpanLink if persistPreviousTrace is false (as by default). Let me take another look

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I rewrote this a bit based on your suggestion as well as on unifying the two options. b44e790

Comment threadpackages/browser/src/tracing/previousTrace.ts
@Lms24
Lms24force-pushed the lms/feat-previous-trace-links branch from 0550ac6 to 6c42afdCompareMarch 20, 2025 14:25
@Lms24
Lms24 requested a review from s1gr1dMarch 21, 2025 09:56

@s1gr1ds1gr1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Such nice API 🥇

@Lms24
Lms24 merged commit 1a4fa0c into developMar 21, 2025
@Lms24
Lms24 deleted the lms/feat-previous-trace-links branch March 21, 2025 10:21
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 17, 2025
![snyk-io[bot]](https://badgen.net/badge/icon/snyk-io%5Bbot%5D/green?label=)
![Contributor](https://badgen.net/badge/icon/Contributor/000000?label=)
[<img width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.7.0 to
9.9.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **2 versions** ahead of your current
version.
- The recommended version was released **24 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.8.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.8.0">2025-03-21</a></br><ul>
<li>feat(node): Implement new continuous profiling API spec (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15635"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15635/hovercard">#15635</a>)</li>
<li>feat(profiling): Add platform to chunk envelope (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15758"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15758/hovercard">#15758</a>)</li>
<li>feat(react): Export captureReactException method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15746"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15746/hovercard">#15746</a>)</li>
<li>fix(node): Check for <code>res.end</code> before passing to Proxy
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15776"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15776/hovercard">#15776</a>)</li>
<li>perf(core): Add short-circuits to <code>eventFilters</code>
integration (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15752"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15752/hovercard">#15752</a>)</li>
<li>perf(node): Short circuit flushing on Vercel only for Vercel (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15734"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15734/hovercard">#15734</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.29 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.11 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.51 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.15 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.43 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.94 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.73 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.1 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.26 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.53 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.04 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.33 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.52 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.38 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.41 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.61 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.68 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.06 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.32 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.88 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.56 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.76 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.65 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.04 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.41 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.7.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.7.0">2025-03-20</a></br><ul>
<li>feat(core): Add <code>captureLog</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15717"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15717/hovercard">#15717</a>)</li>
<li>feat(remix/cloudflare): Export <code>sentryHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15726"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15726/hovercard">#15726</a>)</li>
<li>fix(node): Always flush on Vercel before Lambda freeze (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15602"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15602/hovercard">#15602</a>)</li>
<li>fix(node): Ensure incoming traces are propagated without
HttpInstrumentation (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15732"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15732/hovercard">#15732</a>)</li>
<li>fix(node): Use <code>fatal</code> level for unhandled rejections in
<code>strict</code> mode (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15720"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15720/hovercard">#15720</a>)</li>
<li>fix(nuxt): Delete Nuxt server template injection (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15749"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15749/hovercard">#15749</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.28 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.09 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.33 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.5 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>66.93 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.13 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.69 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.7 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25.08 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.23 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.02 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.3 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.49 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.37 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.57 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.56 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>107.94 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.2 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.77 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.52 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.73 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.62 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.01 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.37 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJjNzI0M2IxOS0yMmVlLTQ5NWItYWJhMS02YjJlOGVhY2FlYjYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImM3MjQzYjE5LTIyZWUtNDk1Yi1hYmExLTZiMmU4ZWFjYWViNiJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.7.0","to":"9.9.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","prPublicId":"c7243b19-22ee-495b-aba1-6b2e8eacaeb6","packageManager":"npm","priorityScoreList":[],"projectPublicId":"55e114f8-489e-4f14-b900-20574b041e59","projectUrl":"https://app.snyk.io/org/reisene/project/55e114f8-489e-4f14-b900-20574b041e59?utm_source=github-cloud-app&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2025-03-24T13:46:37.750Z"},"vulns":[]}'
## Podsumowanie od Sourcery
Aktualizacja @sentry/browser z wersji 9.7.0 do 9.9.0
Ulepszenia:
- Dodano wsparcie dla instrumentacji po stronie klienta Next.js
- Wprowadzono możliwość łączenia poprzednich śladów (traces)
- Dodano metody loggera dla nadchodzącego produktu do logowania Sentry
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.7.0 to 9.9.0
Enhancements:
- Added support for Next.js client-side instrumentation
- Introduced ability to link previous traces
- Added logger methods for upcoming Sentry logging product
</details>
mergifyBot added a commit to reisene/HulajDusza-serwis that referenced this pull request Apr 18, 2025
![reisene](https://badgen.net/badge/icon/reisene/green?label=) [<img
width="16" alt="Powered by Pull Request Badge"
src="https://user-images.githubusercontent.com/1393946/111216524-d2bb8e00-85d4-11eb-821b-ed4c00989c02.png">](https://pullrequestbadge.com/?utm_medium=github&utm_source=reisene&utm_campaign=badge_info)<!--
PR-BADGE: PLEASE DO NOT REMOVE THIS COMMENT -->
<!--- SUMMARY_MARKER --->
## Sweep Summary <sub><a href="https://app.sweep.dev"><img
src="https://raw.githubusercontent.com/sweepai/sweep/main/.assets/sweep-square.png"
width="25" alt="Sweep"></a></sub>
Adds user registration functionality with email uniqueness validation
and password encoding to the HulajDusza service.
- Created `UserRegistrationDto` with validation annotations for email,
password, and name fields.
- Added `isEmailInUse` method to `UserService` to check if an email is
already registered.
- Implemented `registerUser` method in `UserServiceImpl` that creates a
new user with encoded password.
- Added `/api/users/register` endpoint in `UserController` that handles
user registration requests and returns appropriate HTTP responses.
---
[Ask Sweep AI questions about this PR](https://app.sweep.dev)
<!--- SUMMARY_MARKER --->
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)
<h3>Snyk has created this PR to upgrade @sentry/browser from 9.9.0 to
9.10.0.</h3>
:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>
- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **22 days ago**.
<details>
<summary><b>Release notes</b></summary>
<br/>
<details>
<summary>Package name: <b>@sentry/browser</b></summary>
<ul>
<li>
<b>9.10.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.10.0">2025-03-27</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat: Add support for logs</strong></p>
<ul>
<li>feat(node): Add logging public APIs to Node SDKs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15764"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15764/hovercard">#15764</a>)</li>
<li>feat(core): Add support for <code>beforeSendLog</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15814"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15814/hovercard">#15814</a>)</li>
<li>feat(core): Add support for parameterizing logs (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15812"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15812/hovercard">#15812</a>)</li>
<li>fix: Remove critical log severity level (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15824"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15824/hovercard">#15824</a>)</li>
</ul>
<p>All JavaScript SDKs other than <code>@ sentry/cloudflare</code> and
<code>@ sentry/deno</code> now support sending logs via dedicated
methods as part of Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>.</p>
<p>Logging is gated by an experimental option,
<code>_experiments.enableLogs</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'PUBLIC_DSN',
// `enableLogs` must be set to true to use the logging features
_experiments: { enableLogs: true },
});
const { trace, debug, info, warn, error, fatal, fmt } = Sentry.logger;
trace('Starting database connection', { database: 'users' });
debug('Cache miss for user', { userId: 123 });
error('Failed to process payment', { orderId: 'order_123', amount: 99.99
});
fatal('Database connection pool exhausted', { database: 'users',
activeConnections: 100 });
// Structured logging via the `fmt` helper function. When you use `fmt`,
the string template and parameters are sent separately so they can be
queried independently in Sentry.
info(fmt(`Updated profile for user ${userId}`));
warn(fmt(`Rate limit approaching for endpoint ${endpoint}. Requests:
${requests}, Limit: ${limit}`));"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'PUBLIC_DSN'</span><span class="pl-kos">,</span>
<span class="pl-c">// `enableLogs` must be set to true to use the
logging features</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> trace<span
class="pl-kos">,</span> debug<span class="pl-kos">,</span> info<span
class="pl-kos">,</span> warn<span class="pl-kos">,</span> error<span
class="pl-kos">,</span> fatal<span class="pl-kos">,</span> fmt <span
class="pl-kos">}</span> <span class="pl-c1">=</span> <span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">;</span>
<span class="pl-en">trace</span><span class="pl-kos">(</span><span
class="pl-s">'Starting database connection'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-en">debug</span><span class="pl-kos">(</span><span
class="pl-s">'Cache miss for user'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">userId</span>: <span
class="pl-c1">123</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">error</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to process payment'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">orderId</span>: <span class="pl-s">'order_123'</span><span
class="pl-kos">,</span> <span class="pl-c1">amount</span>: <span
class="pl-c1">99.99</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">fatal</span><span class="pl-kos">(</span><span
class="pl-s">'Database connection pool exhausted'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">database</span>: <span class="pl-s">'users'</span><span
class="pl-kos">,</span> <span class="pl-c1">activeConnections</span>:
<span class="pl-c1">100</span> <span class="pl-kos">}</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Structured logging via the `fmt` helper function.
When you use `fmt`, the string template and parameters are sent
separately so they can be queried independently in Sentry.</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Updated profile for user <span class="pl-s1"><span
class="pl-kos">${</span><span class="pl-s1">userId</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-en">fmt</span><span class="pl-kos">(</span><span
class="pl-s">`Rate limit approaching for endpoint <span
class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">endpoint</span><span class="pl-kos">}</span></span>.
Requests: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">requests</span><span class="pl-kos">}</span></span>,
Limit: <span class="pl-s1"><span class="pl-kos">${</span><span
class="pl-s1">limit</span><span
class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span
class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p>With server-side SDKs like <code>@ sentry/node</code>, <code>@
sentry/bun</code> or server-side of <code>@ sentry/nextjs</code> or
<code>@ sentry/sveltekit</code>, you can do structured logging without
needing the <code>fmt</code> helper function.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const { info, warn }
= Sentry.logger;
info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404
});"><pre><span class="pl-k">const</span> <span class="pl-kos">{</span>
info<span class="pl-kos">,</span> warn <span class="pl-kos">}</span>
<span class="pl-c1">=</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-c1">logger</span><span
class="pl-kos">;</span>
<span class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'User %s logged in successfully'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">warn</span><span class="pl-kos">(</span><span
class="pl-s">'Failed to load user %s data'</span><span
class="pl-kos">,</span> <span class="pl-kos">[</span><span
class="pl-c1">123</span><span class="pl-kos">]</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">errorCode</span>: <span class="pl-c1">404</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>To filter logs, or update them before they are sent to Sentry, you
can use the <code>_experiments.beforeSendLog</code> option.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>diagnoseSdkConnectivity()</code>
function to programmatically detect possible connectivity issues (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15821"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15821/hovercard">#15821</a>)</strong></p>
<p>The <code>diagnoseSdkConnectivity()</code> function can be used to
programmatically detect possible connectivity issues with the Sentry
SDK.</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="const result = await
Sentry.diagnoseSdkConnectivity();"><pre><span class="pl-k">const</span>
<span class="pl-s1">result</span> <span class="pl-c1">=</span> <span
class="pl-k">await</span> <span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span
class="pl-en">diagnoseSdkConnectivity</span><span
class="pl-kos">(</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
<p>The result will be an object with the following properties:</p>
<ul>
<li><code>"no-client-active"</code>: There was no active client when the
function was called. This possibly means that the SDK was not
initialized yet.</li>
<li><code>"sentry-unreachable"</code>: The Sentry SaaS servers were not
reachable. This likely means that there is an ad blocker active on the
page or that there are other connection issues.</li>
<li><code>undefined</code>: The SDK is working as expected.</li>
</ul>
</li>
<li>
<p><strong>SDK Tracing Performance Improvements for Node
SDKs</strong></p>
<ul>
<li>feat: Stop using <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15796"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15796/hovercard">#15796</a>)</li>
<li>feat(node): Only add span listeners for instrumentation when used
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15802"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15802/hovercard">#15802</a>)</li>
<li>ref: Avoid <code>dropUndefinedKeys</code> for
<code>spanToJSON</code> calls (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15792"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15792/hovercard">#15792</a>)</li>
<li>ref: Avoid using <code>SentryError</code> for PromiseBuffer control
flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15822"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15822/hovercard">#15822</a>)</li>
<li>ref: Stop using <code>dropUndefinedKeys</code> in SpanExporter (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15794"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15794/hovercard">#15794</a>)</li>
<li>ref(core): Avoid using <code>SentryError</code> for event processing
control flow (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15823"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15823/hovercard">#15823</a>)</li>
<li>ref(node): Avoid <code>dropUndefinedKeys</code> in Node SDK init (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15797"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15797/hovercard">#15797</a>)</li>
<li>ref(opentelemetry): Avoid sampling work for non-root spans (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15820"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15820/hovercard">#15820</a>)</li>
</ul>
<p>We've been hard at work making performance improvements to the Sentry
Node SDKs (<code>@ sentry/node</code>, <code>@
sentry/aws-serverless</code>, <code>@ sentry/nestjs</code>, etc.). We've
seen that upgrading from <code>9.7.0</code> to <code>9.10.0</code> leads
to 30-40% improvement in request latency for HTTP web-server
applications that use tracing with high sample rates. Non web-server
applications and non-tracing applications will see smaller
improvements.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>chore(deps): Bump <code>rrweb</code> to <code>2.35.0</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15825"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15825/hovercard">#15825</a>)</li>
<li>deps: Bump bundler plugins to <code>3.2.3</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15829"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15829/hovercard">#15829</a>)</li>
<li>feat: Always truncate stored breadcrumb messages to 2kb (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15819"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15819/hovercard">#15819</a>)</li>
<li>feat(nextjs): Disable server webpack-handling for static builds (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15751"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15751/hovercard">#15751</a>)</li>
<li>fix(nuxt): Don't override Nuxt options if undefined (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15795"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15795/hovercard">#15795</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.08 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>22.88 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.49 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.65 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.3 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>90.87 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.71 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.5 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>24.86 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.39 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.3 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.18 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.12 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.33 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.51 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.53 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.71 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>70.93 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.11 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.4 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>231.97 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.68 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>36.92 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.91 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96.12 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.46 KB</td>
</tr>
</tbody>
</table>
</li>
<li>
<b>9.9.0</b> - <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases/tag/9.9.0">2025-03-24</a></br><h3>Important
Changes</h3>
<ul>
<li>
<p><strong>feat(nextjs): Support <code>instrumentation-client.ts</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15705"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15705/hovercard">#15705</a>)</strong></p>
<p>Next.js recently added a feature to support <a
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/clientInstrumentationHook"
rel="nofollow">client-side (browser) instrumentation via the
<code>experimental.clientInstrumentationHook</code> flag and the
<code>instrumentation-client.ts</code> file</a>.</p>
<p>To be forwards compatible, the Sentry Next.js SDK will now pick up
<code>instrumentation-client.ts</code> files even on older Next.js
versions and add them to your client bundles.<br>
It is suggested that you either rename your
<code>sentry.client.config.ts</code> file to
<code>instrumentation-client.ts</code>, or if you already happen to have
a <code>instrumentation-client.ts</code> file move the contents of
<code>sentry.client.config.ts</code> to
<code>instrumentation-client.ts</code>.</p>
</li>
<li>
<p><strong>feat(browser): Add <code>previous_trace</code> span links (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15569"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15569/hovercard">#15569</a>)</strong></p>
<p>The <code>@ sentry/browser</code> SDK and SDKs based on <code>@
sentry/browser</code> now emits a link from the first root span of a
newly started trace to the root span of a previously started trace. You
can control this feature via an option in
<code>browserTracingIntegration()</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here'
integrations: [
Sentry.browserTracingIntegration({
// Available settings:
// - 'in-memory' (default): Stores previous trace information in memory
// - 'session-storage': Stores previous trace information in the
browser's `sessionStorage`
// - 'off': Disable storing and sending previous trace information
linkPreviousTrace: 'in-memory',
}),
],
});"><pre><span class="pl-v">Sentry</span><span
class="pl-kos">.</span><span class="pl-en">init</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span>
<span class="pl-s1">integrations</span>: <span class="pl-kos">[</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">browserTracingIntegration</span><span
class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c">// Available settings:</span>
<span class="pl-c">// - 'in-memory' (default): Stores previous trace
information in memory</span>
<span class="pl-c">// - 'session-storage': Stores previous trace
information in the browser's `sessionStorage`</span>
<span class="pl-c">// - 'off': Disable storing and sending previous
trace information</span>
<span class="pl-c1">linkPreviousTrace</span>: <span
class="pl-s">'in-memory'</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span></pre></div>
</li>
<li>
<p><strong>feat(browser): Add <code>logger.X</code> methods to browser
SDK (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15763"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15763/hovercard">#15763</a>)</strong></p>
<p>For Sentry's <a
href="https://redirect.github.com/getsentry/sentry/discussions/86804">upcoming
logging product</a>, the SDK now supports sending logs via dedicated</p>
<div class="highlight highlight-source-js notranslate position-relative
overflow-auto" data-snippet-clipboard-copy-content="Sentry.init({
dsn: 'your-dsn-here',
_experiments: {
enableLogs: true, // This is required to use the logging features
},
});
Sentry.logger.info('This is a trace message', { userId: 123 });
// See PR for better documentation"><pre><span
class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-en">init</span><span class="pl-kos">(</span><span
class="pl-kos">{</span>
<span class="pl-c1">dsn</span>: <span
class="pl-s">'your-dsn-here'</span><span class="pl-kos">,</span>
<span class="pl-c1">_experiments</span>: <span class="pl-kos">{</span>
<span class="pl-c1">enableLogs</span>: <span
class="pl-c1">true</span><span class="pl-kos">,</span> <span
class="pl-c">// This is required to use the logging features</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-v">Sentry</span><span class="pl-kos">.</span><span
class="pl-c1">logger</span><span class="pl-kos">.</span><span
class="pl-en">info</span><span class="pl-kos">(</span><span
class="pl-s">'This is a trace message'</span><span
class="pl-kos">,</span> <span class="pl-kos">{</span> <span
class="pl-c1">userId</span>: <span class="pl-c1">123</span> <span
class="pl-kos">}</span><span class="pl-kos">)</span><span
class="pl-kos">;</span>
<span class="pl-c">// See PR for better documentation</span></pre></div>
<p>Please note that the logs product is still in early access. See the
link above for more information.</p>
</li>
</ul>
<h3>Other Changes</h3>
<ul>
<li>feat(browser): Attach host as part of error message to "Failed to
fetch" errors (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15729"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15729/hovercard">#15729</a>)</li>
<li>feat(core): Add <code>parseStringToURL</code> method (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15768"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15768/hovercard">#15768</a>)</li>
<li>feat(core): Optimize <code>dropUndefinedKeys</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15760"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15760/hovercard">#15760</a>)</li>
<li>feat(node): Add fastify <code>shouldHandleError</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15771"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15771/hovercard">#15771</a>)</li>
<li>fix(nuxt): Delete no longer needed Nitro 'close' hook (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15790"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15790/hovercard">#15790</a>)</li>
<li>perf(nestjs): Remove usage of <code>addNonEnumerableProperty</code>
(<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15766"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15766/hovercard">#15766</a>)</li>
<li>ref: Avoid some usage of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15757"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15757/hovercard">#15757</a>)</li>
<li>ref: Remove some usages of <code>dropUndefinedKeys()</code> (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15781"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15781/hovercard">#15781</a>)</li>
<li>ref(nextjs): Fix Next.js vercel-edge runtime package information (<a
href="https://redirect.github.com/getsentry/sentry-javascript/pull/15789"
data-hovercard-type="pull_request"
data-hovercard-url="/getsentry/sentry-javascript/pull/15789/hovercard">#15789</a>)</li>
</ul>
<h2>Bundle size 📦</h2>
<table>
<thead>
<tr>
<th>Path</th>
<th>Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>@ sentry/browser</td>
<td>23.21 KB</td>
</tr>
<tr>
<td>@ sentry/browser - with treeshaking flags</td>
<td>23.01 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing)</td>
<td>36.62 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay)</td>
<td>73.79 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay) - with treeshaking
flags</td>
<td>67.12 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay with Canvas)</td>
<td>78.42 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Tracing, Replay, Feedback)</td>
<td>91 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. Feedback)</td>
<td>40.34 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. sendFeedback)</td>
<td>27.85 KB</td>
</tr>
<tr>
<td>@ sentry/browser (incl. FeedbackAsync)</td>
<td>32.63 KB</td>
</tr>
<tr>
<td>@ sentry/react</td>
<td>25 KB</td>
</tr>
<tr>
<td>@ sentry/react (incl. Tracing)</td>
<td>38.52 KB</td>
</tr>
<tr>
<td>@ sentry/vue</td>
<td>27.44 KB</td>
</tr>
<tr>
<td>@ sentry/vue (incl. Tracing)</td>
<td>38.3 KB</td>
</tr>
<tr>
<td>@ sentry/svelte</td>
<td>23.25 KB</td>
</tr>
<tr>
<td>CDN Bundle</td>
<td>24.43 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing)</td>
<td>36.63 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay)</td>
<td>71.62 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback)</td>
<td>76.83 KB</td>
</tr>
<tr>
<td>CDN Bundle - uncompressed</td>
<td>71.39 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing) - uncompressed</td>
<td>108.59 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay) - uncompressed</td>
<td>219.84 KB</td>
</tr>
<tr>
<td>CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed</td>
<td>232.41 KB</td>
</tr>
<tr>
<td>@ sentry/nextjs (client)</td>
<td>39.81 KB</td>
</tr>
<tr>
<td>@ sentry/sveltekit (client)</td>
<td>37.03 KB</td>
</tr>
<tr>
<td>@ sentry/node</td>
<td>142.61 KB</td>
</tr>
<tr>
<td>@ sentry/node - without tracing</td>
<td>96 KB</td>
</tr>
<tr>
<td>@ sentry/aws-serverless</td>
<td>120.36 KB</td>
</tr>
</tbody>
</table>
</li>
</ul>
from <a
href="https://redirect.github.com/getsentry/sentry-javascript/releases">@sentry/browser
GitHub release notes</a>
</details>
</details>
---
> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.
---
**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._
**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmYjEwN2UyYy01YjQ3LTRlMzAtYWM2Ni1iN2NjNmM1NTFmNTAiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImZiMTA3ZTJjLTViNDctNGUzMC1hYzY2LWI3Y2M2YzU1MWY1MCJ9fQ=="
width="0" height="0"/>
> - 🧐 [View latest project
report](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83/settings/integration?pkg&#x3D;@sentry/browser&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)
[//]: #
'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@sentry/browser","from":"9.9.0","to":"9.10.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","prPublicId":"fb107e2c-5b47-4e30-ac66-b7cc6c551f50","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3b48baaa-833b-4239-b348-16091472ee83","projectUrl":"https://app.snyk.io/org/reisene/project/3b48baaa-833b-4239-b348-16091472ee83?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-03-27T18:39:06.554Z"},"vulns":[]}'
## Podsumowanie wygenerowane przez Sourcery
Aktualizacja @sentry/browser z wersji 9.9.0 do 9.10.0, zawierająca nowe
funkcje i poprawki wydajności.
Nowe funkcje:
- Wprowadzono metody logowania z eksperymentalnym wsparciem logów
- Dodano możliwość łączenia poprzednich śladów (traces) w śledzeniu
przeglądarki (browser tracing)
Ulepszenia:
- Dodano wsparcie dla programowego diagnozowania problemów z łącznością
SDK
- Poprawiono wydajność dla Node SDK dzięki optymalizacjom śledzenia
(tracing optimizations)
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Upgrade @sentry/browser from version 9.9.0 to 9.10.0, incorporating new
features and performance improvements
New Features:
- Introduced logging methods with experimental log support
- Added ability to link previous traces in browser tracing
Enhancements:
- Added support for programmatically diagnosing SDK connectivity issues
- Improved performance for Node SDKs with tracing optimizations
</details>
Sign up for freeto 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.

Add previous_trace span link to browserTracingIntegration root spans

2 participants

@Lms24@s1gr1d