Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta(changelog): Update changelog for 9.10.0 #15867

Merged
merged 29 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9cdd2d9
feat(nextjs): Disable server webpack-handling for static builds (#15751)
s1gr1d Mar 24, 2025
fa9376c
fix(nuxt): Don't override Nuxt options if undefined (#15795)
s1gr1d Mar 24, 2025
34b69b3
ref: Avoid `dropUndefinedKeys` for `spanToJSON` calls (#15792)
mydea Mar 24, 2025
244c87f
ref(node): Avoid `dropUndefinedKeys` in Node SDK init (#15797)
mydea Mar 24, 2025
4262d53
ref: Stop using `dropUndefinedKeys` in SpanExporter (#15794)
mydea Mar 24, 2025
c622c8a
test(node-integration): Skip flaky tedious tests (#15798)
Lms24 Mar 24, 2025
85e59d3
chore(deps): bump nuxt from 3.7.0 to 3.16.0 in /dev-packages/e2e-test…
dependabot[bot] Mar 24, 2025
aeec85a
test(nuxt): Reduce version in Nuxt min test (#15800)
s1gr1d Mar 24, 2025
e62f334
Merge pull request #15801 from getsentry/master
github-actions[bot] Mar 24, 2025
ef67fdc
test: Add browser integration test for AggregateErrors (#15723)
AbhiPrasad Mar 24, 2025
38a499a
chore(deps): bump next from 14.0.2 to 14.2.25 in /dev-packages/e2e-te…
dependabot[bot] Mar 24, 2025
2ed6fc2
feat(node): Add logging public APIs to Node SDKs (#15764)
AbhiPrasad Mar 24, 2025
2e26182
feat(browser): Add `diagnoseSdkConnectivity()` function to programmat…
lforst Mar 25, 2025
f2f21ee
ref(browser-utils): Give parseUrl a better name (#15813)
AbhiPrasad Mar 25, 2025
9ca030d
feat(core): Add support for `beforeSendLog` (#15814)
AbhiPrasad Mar 25, 2025
d650218
feat(core): Add support for parameterizing logs (#15812)
AbhiPrasad Mar 25, 2025
c276386
ref: Avoid using `SentryError` for PromiseBuffer control flow (#15822)
mydea Mar 25, 2025
7f1087d
feat: Stop using `dropUndefinedKeys` (#15796)
mydea Mar 25, 2025
c14ab92
ref(core): Avoid using `SentryError` for event processing control flo…
mydea Mar 25, 2025
c2d0b2c
fix: Remove critical log severity level (#15824)
AbhiPrasad Mar 25, 2025
00a1018
chore(deps): Bump `rrweb` to `2.35.0` (#15825)
chargome Mar 25, 2025
12c5e73
test(google-serverless): Migrate to Vitest (#15567)
timfish Mar 25, 2025
c38315e
chore(jest): Final Jest cleanup (#15549)
timfish Mar 26, 2025
05391d0
feat(node): Only add span listeners for instrumentation when used (#1…
mydea Mar 26, 2025
7191ebd
feat: Always truncate stored breadcrumb messages to 2kb (#15819)
lforst Mar 26, 2025
b0a1b06
test: Add browser and nodejs integration tests for logs (#15815)
AbhiPrasad Mar 26, 2025
2284e81
deps: Bump bundler plugins to `3.2.3` (#15829)
lforst Mar 26, 2025
ef2f35d
ref(opentelemetry): Avoid sampling work for non-root spans (#15820)
mydea Mar 26, 2025
d430d96
meta(changelog): Update changelog for 9.10.0
AbhiPrasad Mar 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = {
},
},
{
files: ['jest/**/*.ts', 'scripts/**/*.ts'],
files: ['scripts/**/*.ts'],
parserOptions: {
project: ['tsconfig.dev.json'],
},
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ scratch/
# side effects of running AWS lambda layer zip action locally
dist-serverless/
sentry-node-serverless-*.zip
# transpiled transformers
jest/transformers/*.js
# node tarballs
packages/*/sentry-*.tgz
.nxcache
Expand Down
29 changes: 0 additions & 29 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,35 +52,6 @@
"internalConsoleOptions": "openOnSessionStart",
"outputCapture": "std"
},
// Run a specific test file in watch mode (must have file in currently active tab when hitting the play button).
// NOTE: If you try to run this and VSCode complains that the command `shellCommand.execute` can't be found, go
// install the recommended extension Tasks Shell Input.
{
"name": "Debug unit tests - just open file",
"type": "node",
"cwd": "${workspaceFolder}/packages/${input:getPackageName}",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"--watch",
// this runs one test at a time, rather than running them in parallel (necessary for debugging so that you know
// you're hitting a single test's breakpoints, in order)
"--runInBand",
// coverage messes up the source maps
"--coverage",
"false",
// remove this to run all package tests
"${relativeFile}"
],
"sourceMaps": true,
"smartStep": true,
// otherwise it goes to the VSCode debug terminal, which prints the test output or console logs (depending on
// "outputCapture" option here; default is to show console logs), but not both
"console": "integratedTerminal",
// since we're not using it, don't automatically switch to it
"internalConsoleOptions": "neverOpen"
},

// Run a specific test file in watch mode (must have file in currently active tab when hitting the play button).
// NOTE: If you try to run this and VSCode complains that the command `shellCommand.execute` can't be found, go
// install the recommended extension Tasks Shell Input.
Expand Down
83 changes: 82 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,87 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

## 9.10.0

### Important Changes

- **feat: Add support for logs**

- feat(node): Add logging public APIs to Node SDKs ([#15764](https://github.com/getsentry/sentry-javascript/pull/15764))
- feat(core): Add support for `beforeSendLog` ([#15814](https://github.com/getsentry/sentry-javascript/pull/15814))
- feat(core): Add support for parameterizing logs ([#15812](https://github.com/getsentry/sentry-javascript/pull/15812))
- fix: Remove critical log severity level ([#15824](https://github.com/getsentry/sentry-javascript/pull/15824))

All JavaScript SDKs other than `@sentry/cloudflare` and `@sentry/deno` now support sending logs via dedicated methods as part of Sentry's [upcoming logging product](https://github.com/getsentry/sentry/discussions/86804).

Logging is gated by an experimental option, `_experiments.enableLogs`.

```js
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}`));
```

With server-side SDKs like `@sentry/node`, `@sentry/bun` or server-side of `@sentry/nextjs` or `@sentry/sveltekit`, you can do structured logging without needing the `fmt` helper function.

```js
const { info, warn } = Sentry.logger;

info('User %s logged in successfully', [123]);
warn('Failed to load user %s data', [123], { errorCode: 404 });
```

To filter logs, or update them before they are sent to Sentry, you can use the `_experiments.beforeSendLog` option.

- **feat(browser): Add `diagnoseSdkConnectivity()` function to programmatically detect possible connectivity issues ([#15821](https://github.com/getsentry/sentry-javascript/pull/15821))**

The `diagnoseSdkConnectivity()` function can be used to programmatically detect possible connectivity issues with the Sentry SDK.

```js
const result = await Sentry.diagnoseSdkConnectivity();
```

The result will be an object with the following properties:

- `"no-client-active"`: There was no active client when the function was called. This possibly means that the SDK was not initialized yet.
- `"sentry-unreachable"`: 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.
- `undefined`: The SDK is working as expected.

- **SDK Tracing Performance Improvements for Node SDKs**

- feat: Stop using `dropUndefinedKeys` ([#15796](https://github.com/getsentry/sentry-javascript/pull/15796))
- feat(node): Only add span listeners for instrumentation when used ([#15802](https://github.com/getsentry/sentry-javascript/pull/15802))
- ref: Avoid `dropUndefinedKeys` for `spanToJSON` calls ([#15792](https://github.com/getsentry/sentry-javascript/pull/15792))
- ref: Avoid using `SentryError` for PromiseBuffer control flow ([#15822](https://github.com/getsentry/sentry-javascript/pull/15822))
- ref: Stop using `dropUndefinedKeys` in SpanExporter ([#15794](https://github.com/getsentry/sentry-javascript/pull/15794))
- ref(core): Avoid using `SentryError` for event processing control flow ([#15823](https://github.com/getsentry/sentry-javascript/pull/15823))
- ref(node): Avoid `dropUndefinedKeys` in Node SDK init ([#15797](https://github.com/getsentry/sentry-javascript/pull/15797))
- ref(opentelemetry): Avoid sampling work for non-root spans ([#15820](https://github.com/getsentry/sentry-javascript/pull/15820))

We've been hard at work making performance improvements to the Sentry Node SDKs (`@sentry/node`, `@sentry/aws-serverless`, `@sentry/nestjs`, etc.). We've seen that upgrading from `9.7.0` to `9.10.0` 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.

### Other Changes

- chore(deps): Bump `rrweb` to `2.35.0` ([#15825](https://github.com/getsentry/sentry-javascript/pull/15825))
- deps: Bump bundler plugins to `3.2.3` ([#15829](https://github.com/getsentry/sentry-javascript/pull/15829))
- feat: Always truncate stored breadcrumb messages to 2kb ([#15819](https://github.com/getsentry/sentry-javascript/pull/15819))
- feat(nextjs): Disable server webpack-handling for static builds ([#15751](https://github.com/getsentry/sentry-javascript/pull/15751))
- fix(nuxt): Don't override Nuxt options if undefined ([#15795](https://github.com/getsentry/sentry-javascript/pull/15795))

## 9.9.0

### Important Changes
Expand Down Expand Up @@ -42,7 +123,7 @@

- **feat(browser): Add `logger.X` methods to browser SDK ([#15763](https://github.com/getsentry/sentry-javascript/pull/15763))**

For Sentry's [upcoming logging product](https://github.com/getsentry/sentry/discussions/86804), the SDK now supports sending logs via dedicated
For Sentry's [upcoming logging product](https://github.com/getsentry/sentry/discussions/86804), the SDK now supports sending logs via dedicated methods.

```js
Sentry.init({
Expand Down
17 changes: 0 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,6 @@ the tests in each location. Check out the `scripts` entry of the corresponding `

Note: you must run `yarn build` before `yarn test` will work.

## Debugging Tests

If you run into trouble writing tests and need to debug one of them, you can do so using VSCode's debugger.

0. If you don't already have it installed, install the Tasks Shell Input extension, which you'll find in the Extensions
tab in the sidebar as one of the recommended workspace extensions.

1. Place breakpoints or `debugger` statements in the test or the underlying code wherever you'd like `jest` to pause.
2. Open the file containing the test in question, and make sure its tab is active (so you can see the file's contents).
3. Switch to the debugger in the sidebar and choose `Debug unit tests - just open file` from the dropdown.
4. Click the green "play" button to run the tests in the open file in watch mode.

Pro tip: If any of your breakpoints are in code run by multiple tests, and you run the whole test file, you'll land on
those breakpoints over and over again, in the middle of tests you don't care about. To avoid this, replace the test's
initial `it` or `test` with `it.only` or `test.only`. That way, when you hit a breakpoint, you'll know you got there are
part of the buggy test.

## Debug Build Flags

Throughout the codebase, you will find a `__DEBUG_BUILD__` constant. This flag serves two purposes:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
try {
// Create an AggregateError with multiple error objects
const error1 = new Error('First error message');
const error2 = new TypeError('Second error message');
const error3 = new RangeError('Third error message');

// Create the AggregateError with these errors and a message
const aggregateError = new AggregateError([error1, error2, error3], 'Multiple errors occurred');

throw aggregateError;
} catch (err) {
Sentry.captureException(err);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { expect } from '@playwright/test';

import { sentryTest } from '../../../../utils/fixtures';
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';

sentryTest('should capture an AggregateError with embedded errors', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForErrorRequestOnUrl(page, url);
const eventData = envelopeRequestParser(req);

expect(eventData.exception?.values).toHaveLength(4); // AggregateError + 3 embedded errors

// Verify the embedded errors come first
expect(eventData.exception?.values?.[0]).toMatchObject({
type: 'RangeError',
value: 'Third error message',
mechanism: {
type: 'chained',
handled: true,
source: expect.stringMatching(/^errors\[\d+\]$/),
exception_id: expect.any(Number),
},
});

expect(eventData.exception?.values?.[1]).toMatchObject({
type: 'TypeError',
value: 'Second error message',
mechanism: {
type: 'chained',
handled: true,
source: expect.stringMatching(/^errors\[\d+\]$/),
exception_id: expect.any(Number),
},
});

expect(eventData.exception?.values?.[2]).toMatchObject({
type: 'Error',
value: 'First error message',
mechanism: {
type: 'chained',
handled: true,
source: expect.stringMatching(/^errors\[\d+\]$/),
exception_id: expect.any(Number),
},
});

// Verify the AggregateError comes last
expect(eventData.exception?.values?.[3]).toMatchObject({
type: 'AggregateError',
value: 'Multiple errors occurred',
mechanism: {
type: 'generic',
handled: true,
is_exception_group: true,
exception_id: expect.any(Number),
},
stacktrace: {
frames: expect.any(Array),
},
});

// Get parent exception ID for reference checks
const parentId = eventData.exception?.values?.[3].mechanism?.exception_id;

// Verify parent_id references match for all child errors
for (let i = 0; i < 3; i++) {
expect(eventData.exception?.values?.[i].mechanism?.parent_id).toBe(parentId);
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
_experiments: {
enableLogs: true,
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Sentry.logger.trace('test trace');
Sentry.logger.debug('test debug');
Sentry.logger.info('test info');
Sentry.logger.warn('test warn');
Sentry.logger.error('test error');
Sentry.logger.fatal('test fatal');

const formattedMessage = (message, stringArg, boolArg, numberArg) => {
return Sentry.logger.fmt`test ${message} ${stringArg} ${boolArg} ${numberArg}`;
};

Sentry.logger.trace(formattedMessage('trace', 'stringArg', false, 123));
Sentry.logger.debug(formattedMessage('debug', 'stringArg', false, 123));
Sentry.logger.info(formattedMessage('info', 'stringArg', false, 123));
Sentry.logger.warn(formattedMessage('warn', 'stringArg', false, 123));
Sentry.logger.error(formattedMessage('error', 'stringArg', false, 123));
Sentry.logger.fatal(formattedMessage('fatal', 'stringArg', false, 123));

Sentry.flush();
Loading
Loading