Skip to content

meta: Update CHANGELOG for 7.93.0 #10131

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

Merged
merged 44 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f28f3a9
Merge pull request #10067 from getsentry/master
github-actions[bot] Jan 4, 2024
5eeb8a9
fix(node): Anr events should have an `event_id` (#10068)
timfish Jan 4, 2024
366ed0b
fix(nextjs): Don't capture not-found and redirect errors in generatio…
Jan 5, 2024
5def983
feat(core): Allow to pass start/end timestamp for spans flexibly (#10…
mydea Jan 5, 2024
89ca41d
feat(core): Deprecate `startTransaction()` (#10073)
mydea Jan 5, 2024
644d697
feat(core): Add `span.isRecording()` instead of `span.sampled` (#10034)
mydea Jan 5, 2024
118b5c7
test(browser): Replace flakey integration test (#10075)
Jan 5, 2024
fffa932
feat(core): Deprecate `Hub.shouldSendDefaultPii` (#10062)
Lms24 Jan 5, 2024
3545c68
feat(utils): Add `parameterize` function (#9145)
AleshaOleg Jan 5, 2024
ecb4f7f
feat(core): Deprecate session APIs on hub and add global replacements…
Lms24 Jan 5, 2024
a443517
fix(node): Revert to only use sync debugger for `LocalVariables` (#10…
timfish Jan 5, 2024
6ebebf4
test(browser-integration-tests): Skip flakey test on chrome (#10078)
Jan 5, 2024
bfb61cf
test(browser-integration): Add test for Replay canvas recording (#10079)
billyvg Jan 5, 2024
0d0e850
fix(cron): Make name required for instrumentNodeCron option (#10070)
AbhiPrasad Jan 5, 2024
2302fdc
fix(node): `LocalVariables` integration should have correct name (#10…
timfish Jan 5, 2024
3fc7916
ref(utils): Clean up timestamp calculation code (#10069)
AbhiPrasad Jan 5, 2024
5aac890
feat(core): Add `spanToJSON()` method to get span properties (#10074)
mydea Jan 8, 2024
548d455
feat(core): Deprecate `span.startChild()` (#10091)
mydea Jan 8, 2024
2cfb0ef
feat(core): Deprecate hub capture APIs and add them to `Scope` (#10039)
Jan 8, 2024
0a97514
ref(node-experimental): Deprecate `lastEventId` on scope (#10093)
Jan 8, 2024
b6c369d
feat(core): Allow to pass `scope` to `startSpan` APIs (#10076)
mydea Jan 8, 2024
73a8314
feat(core): Add `span.spanContext()` (#10037)
mydea Jan 8, 2024
e7552e3
feat(core): Deprecate span `name` and `description` (#10056)
mydea Jan 8, 2024
3160419
test(node): Add memory leak test for `LocalVariables` (#10080)
timfish Jan 8, 2024
b0496ea
fix(astro): use correct package name for CF (#10099)
anonrig Jan 8, 2024
0cbdf67
feat(core): Deprecate arguments for `startSpan()` (#10101)
mydea Jan 8, 2024
4745454
feat(node): Instrumentation for `node-schedule` library (#10086)
timfish Jan 8, 2024
a1b1929
feat(deps): bump @sentry/cli from 2.23.2 to 2.24.1 (#10103)
dependabot[bot] Jan 8, 2024
d305c8d
feat(core): Deprecate `getActiveTransaction()` & `scope.getTransactio…
mydea Jan 8, 2024
4a920b5
fix(node): Update ANR min node version to v16.17.0 (#10107)
timfish Jan 8, 2024
0276c03
feat(core): Deprecate transaction metadata in favor of attributes (#1…
mydea Jan 9, 2024
89cef6b
fix(core): Ensure we copy passed in span data/tags/attributes (#10105)
mydea Jan 9, 2024
d41e39e
feat(core): Deprecate `scope.setTransactionName()` (#10113)
mydea Jan 9, 2024
f70128d
feat(core): Deprecate `scope.getSpan()` & `scope.setSpan()` (#10114)
mydea Jan 9, 2024
15ab8ee
fix(core): Do not run `setup` for integration on client multiple time…
mydea Jan 9, 2024
5623fd8
ref(ember): Use new span APIs (#10111)
AbhiPrasad Jan 9, 2024
eff57fa
feat(node): Make `getModuleFromFilename` compatible with ESM (#10061)
timfish Jan 9, 2024
a157d98
feat(replay): Update rrweb to 2.7.3 (#10072)
mydea Jan 10, 2024
a56fc29
feat(core): Deprecate span `tags`, `data`, `context` & setters (#10053)
mydea Jan 10, 2024
eb5bb3d
feat(core): Deprecate `new Transaction()` (#10125)
mydea Jan 10, 2024
6faec42
feat(core): Deprecate `Transaction.getDynamicSamplingContext` in favo…
Lms24 Jan 10, 2024
1a7ea9b
chore: Add migration docs for `Hub` (#10126)
Jan 10, 2024
1005ba9
meta: Ignore `Transaction` deprecation lint warnings in DSC tests (#1…
Jan 10, 2024
0fb8b64
meta: Update CHANGELOG for 7.93.0
Lms24 Jan 10, 2024
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
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,71 @@

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

## 7.93.0

### Important Changes

#### Deprecations

As we're moving closer to the next major version of the SDK, more public APIs were deprecated.

To get a head start on migrating to the replacement APIs, please take a look at our
[migration guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md).

- feat(core): Deprecate `getActiveTransaction()` & `scope.getTransaction()` (#10098)
- feat(core): Deprecate `Hub.shouldSendDefaultPii` (#10062)
- feat(core): Deprecate `new Transaction()` (#10125)
- feat(core): Deprecate `scope.getSpan()` & `scope.setSpan()` (#10114)
- feat(core): Deprecate `scope.setTransactionName()` (#10113)
- feat(core): Deprecate `span.startChild()` (#10091)
- feat(core): Deprecate `startTransaction()` (#10073)
- feat(core): Deprecate `Transaction.getDynamicSamplingContext` in favor of `getDynamicSamplingContextFromSpan` (#10094)
- feat(core): Deprecate arguments for `startSpan()` (#10101)
- feat(core): Deprecate hub capture APIs and add them to `Scope` (#10039)
- feat(core): Deprecate session APIs on hub and add global replacements (#10054)
- feat(core): Deprecate span `name` and `description` (#10056)
- feat(core): Deprecate span `tags`, `data`, `context` & setters (#10053)
- feat(core): Deprecate transaction metadata in favor of attributes (#10097)
- feat(core): Deprecate `span.sampled` in favor of `span.isRecording()` (#10034)
- ref(node-experimental): Deprecate `lastEventId` on scope (#10093)

#### Cron Monitoring Support for `node-schedule` library

This release adds auto instrumented check-ins for the `node-schedule` library.

```ts
import * as Sentry from '@sentry/node';
import * as schedule from 'node-schedule';

const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule);

const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => {
console.log('You will see this message every minute');
});
```

- feat(node): Instrumentation for `node-schedule` library (#10086)

### Other Changes

- feat(core): Add `span.spanContext()` (#10037)
- feat(core): Add `spanToJSON()` method to get span properties (#10074)
- feat(core): Allow to pass `scope` to `startSpan` APIs (#10076)
- feat(core): Allow to pass start/end timestamp for spans flexibly (#10060)
- feat(node): Make `getModuleFromFilename` compatible with ESM (#10061)
- feat(replay): Update rrweb to 2.7.3 (#10072)
- feat(utils): Add `parameterize` function (#9145)
- fix(astro): Use correct package name for CF (#10099)
- fix(core): Do not run `setup` for integration on client multiple times (#10116)
- fix(core): Ensure we copy passed in span data/tags/attributes (#10105)
- fix(cron): Make name required for instrumentNodeCron option (#10070)
- fix(nextjs): Don't capture not-found and redirect errors in generation functions (#10057)
- fix(node): `LocalVariables` integration should have correct name (#10084)
- fix(node): Anr events should have an `event_id` (#10068)
- fix(node): Revert to only use sync debugger for `LocalVariables` (#10077)
- fix(node): Update ANR min node version to v16.17.0 (#10107)


## 7.92.0

### Important Changes
Expand Down
95 changes: 94 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,89 @@ npx @sentry/migr8@latest

This will let you select which updates to run, and automatically update your code. Make sure to still review all code changes!

## Deprecate `Hub`

The `Hub` has been a very important part of the Sentry SDK API up until now.
Hubs were the SDK's "unit of concurrency" to keep track of data across threads and to scope data to certain parts of your code.
Because it is overly complicated and confusing to power users, it is going to be replaced by a set of new APIs: the "new Scope API".

`Scope`s have existed before in the SDK but we are now expanding on them because we have found them powerful enough to fully cover the `Hub` API.

If you are using the `Hub` right now, see the following table on how to migrate to the new API:

| Old `Hub` API | New `Scope` API |
| --- | --- |
| `new Hub()` | `withScope()`, `withIsolationScope()` or `new Scope()` |
| hub.isOlderThan() | REMOVED - Was used to compare `Hub` instances, which are gonna be removed |
| hub.bindClient() | A combination of `scope.setClient()` and `client.setupIntegrations()` |
| hub.pushScope() | `Sentry.withScope()` |
| hub.popScope() | `Sentry.withScope()` |
| hub.withScope() | `Sentry.withScope()` |
| getClient() | `Sentry.getClient()` |
| getScope() | `Sentry.getCurrentScope()` to get the currently active scope |
| getIsolationScope() | `Sentry.getIsolationScope()` |
| getStack() | REMOVED - The stack used to hold scopes. Scopes are used directly now |
| getStackTop() | REMOVED - The stack used to hold scopes. Scopes are used directly now |
| captureException() | `Sentry.captureException()` |
| captureMessage() | `Sentry.captureMessage()` |
| captureEvent() | `Sentry.captureEvent()` |
| lastEventId() | REMOVED - Use event processors or beforeSend instead |
| addBreadcrumb() | `Sentry.addBreadcrumb()` |
| setUser() | `Sentry.setUser()` |
| setTags() | `Sentry.setTags()` |
| setExtras() | `Sentry.setExtras()` |
| setTag() | `Sentry.setTag()` |
| setExtra() | `Sentry.setExtra()` |
| setContext() | `Sentry.setContext()` |
| configureScope() | REMOVED - Scopes are now the unit of concurrency |
| run() | `Sentry.withScope()` or `Sentry.withIsolationScope()` |
| getIntegration() | `client.getIntegration()` |
| startTransaction() | `Sentry.startSpan()`, `Sentry.startInactiveSpan()` or `Sentry.startSpanManual()` |
| traceHeaders() | REMOVED - The closest equivalent is now `spanToTraceHeader(getActiveSpan())` |
| captureSession() | `Sentry.captureSession()` |
| startSession() | `Sentry.startSession()` |
| endSession() | `Sentry.endSession()` |
| shouldSendDefaultPii() | REMOVED - The closest equivalent is `Sentry.getClient().getOptions().sendDefaultPii` |

## Deprecate `scope.getSpan()` and `scope.setSpan()`

Instead, you can get the currently active span via `Sentry.getActiveSpan()`.
Setting a span on the scope happens automatically when you use the new performance APIs `startSpan()` and `startSpanManual()`.

## Deprecate `scope.setTransactionName()`

Instead, either set this as attributes or tags, or use an event processor to set `event.transaction`.

## Deprecate `scope.getTransaction()` and `getActiveTransaction()`

Instead, you should not rely on the active transaction, but just use `startSpan()` APIs, which handle this for you.

## Deprecate arguments for `startSpan()` APIs

In v8, the API to start a new span will be reduced from the currently available options.
Going forward, only these argument will be passable to `startSpan()`, `startSpanManual()` and `startInactiveSpan()`:

* `name`
* `attributes`
* `origin`
* `op`
* `startTime`
* `scope`

## Deprecate `startTransaction()` & `span.startChild()`

In v8, the old performance API `startTransaction()` (and `hub.startTransaction()`), as well as `span.startChild()`, will be removed.
Instead, use the new performance APIs:

* `startSpan()`
* `startSpanManual()`
* `startInactiveSpan()`

You can [read more about the new performance APIs here](./docs/v8-new-performance-apis.md).

## Deprecate `Sentry.lastEventId()` and `hub.lastEventId()`

`Sentry.lastEventId()` sometimes causes race conditons, so we are deprecating it in favour of the `beforeSend` callback.
`Sentry.lastEventId()` sometimes causes race conditions, so we are deprecating it in favour of the `beforeSend` callback.

```js
// Before
Expand Down Expand Up @@ -46,6 +126,19 @@ In v8, the Span class is heavily reworked. The following properties & methods ar
* `span.setName(newName)`: Use `span.updateName(newName)` instead.
* `span.toTraceparent()`: use `spanToTraceHeader(span)` util instead.
* `span.getTraceContext()`: Use `spanToTraceContext(span)` utility function instead.
* `span.sampled`: Use `span.isRecording()` instead.
* `span.spanId`: Use `span.spanContext().spanId` instead.
* `span.traceId`: Use `span.spanContext().traceId` instead.
* `span.name`: Use `spanToJSON(span).description` instead.
* `span.description`: Use `spanToJSON(span).description` instead.
* `span.getDynamicSamplingContext`: Use `getDynamicSamplingContextFromSpan` utility function instead.
* `transaction.setMetadata()`: Use attributes instead, or set data on the scope.
* `transaction.metadata`: Use attributes instead, or set data on the scope.
* `span.tags`: Set tags on the surrounding scope instead, or use attributes.
* `span.data`: Use `spanToJSON(span).data` instead.
* `span.setTag()`: Use `span.setAttribute()` instead or set tags on the surrounding scope.
* `span.setData()`: Use `span.setAttribute()` instead.
* `transaction.setContext()`: Set context on the surrounding scope instead.

## Deprecate `pushScope` & `popScope` in favor of `withScope`

Expand Down
2 changes: 1 addition & 1 deletion dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"dependencies": {
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "^1.31.1",
"@sentry-internal/rrweb": "2.6.0",
"@sentry-internal/rrweb": "2.7.3",
"@sentry/browser": "7.92.0",
"@sentry/tracing": "7.92.0",
"axios": "1.6.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,62 @@ import type { Event } from '@sentry/types';
import { sentryTest } from '../../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';

sentryTest('captures Breadcrumb for clicks & debounces them for a second', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('**/foo', route => {
return route.fulfill({
status: 200,
body: JSON.stringify({
userNames: ['John', 'Jane'],
}),
headers: {
'Content-Type': 'application/json',
},
sentryTest(
'captures Breadcrumb for clicks & debounces them for a second',
async ({ getLocalTestUrl, page, browserName }) => {
sentryTest.skip(browserName === 'chromium', 'This consistently flakes on chrome.');

const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('**/foo', route => {
return route.fulfill({
status: 200,
body: JSON.stringify({
userNames: ['John', 'Jane'],
}),
headers: {
'Content-Type': 'application/json',
},
});
});
});

const promise = getFirstSentryEnvelopeRequest<Event>(page);

await page.goto(url);

await page.click('#button1');
// not debounced because other target
await page.click('#button2');
// This should be debounced
await page.click('#button2');

// Wait a second for the debounce to finish
await page.waitForTimeout(1000);
await page.click('#button2');

const [eventData] = await Promise.all([promise, page.evaluate('Sentry.captureException("test exception")')]);

expect(eventData.exception?.values).toHaveLength(1);

expect(eventData.breadcrumbs).toEqual([
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button1[type="button"]',
},
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button2[type="button"]',
},
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button2[type="button"]',
},
]);
});

const promise = getFirstSentryEnvelopeRequest<Event>(page);

await page.goto(url);

await page.click('#button1');
// not debounced because other target
await page.click('#button2');
// This should be debounced
await page.click('#button2');

// Wait a second for the debounce to finish
await page.waitForTimeout(1000);
await page.click('#button2');

const [eventData] = await Promise.all([promise, page.evaluate('Sentry.captureException("test exception")')]);

expect(eventData.exception?.values).toHaveLength(1);

expect(eventData.breadcrumbs).toEqual([
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button1[type="button"]',
},
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button2[type="button"]',
},
{
timestamp: expect.any(Number),
category: 'ui.click',
message: 'body > button#button2[type="button"]',
},
]);
},
);

sentryTest(
'uses the annotated component name in the breadcrumb messages and adds it to the data object',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sentry.captureMessage('a');

Sentry.captureException(new Error('test_simple_breadcrumb_error'));
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

import { sentryTest } from '../../../../utils/fixtures';
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';

sentryTest(
'should capture recorded transactions as breadcrumbs for the following event sent',
async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

const events = await getMultipleSentryEnvelopeRequests<Event>(page, 2, { url });

const errorEvent = events.find(event => event.exception?.values?.[0].value === 'test_simple_breadcrumb_error')!;

expect(errorEvent.breadcrumbs).toHaveLength(1);
expect(errorEvent.breadcrumbs?.[0]).toMatchObject({
category: 'sentry.event',
event_id: expect.any(String),
level: expect.any(String),
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Sentry.captureEvent({
event_id: 'aa3ff046696b4bc6b609ce6d28fde9e2',
message: 'someMessage',
transaction: 'wat',
type: 'transaction',
});

Sentry.captureException(new Error('test_simple_breadcrumb_error'));
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

import { sentryTest } from '../../../../utils/fixtures';
import { getMultipleSentryEnvelopeRequests } from '../../../../utils/helpers';

sentryTest(
'should capture recorded transactions as breadcrumbs for the following event sent',
async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

const events = await getMultipleSentryEnvelopeRequests<Event>(page, 2, { url });

const errorEvent = events.find(event => event.exception?.values?.[0].value === 'test_simple_breadcrumb_error')!;

expect(errorEvent.breadcrumbs).toHaveLength(1);
expect(errorEvent.breadcrumbs?.[0]).toMatchObject({
category: 'sentry.transaction',
message: expect.any(String),
});
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { parameterize } from '@sentry/utils';

const x = 'first';
const y = 'second';

Sentry.captureMessage(parameterize`This is a log statement with ${x} and ${y} params`);
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

import { sentryTest } from '../../../../utils/fixtures';
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';

sentryTest('should capture a parameterized representation of the message', async ({ getLocalTestPath, page }) => {
const bundle = process.env.PW_BUNDLE;

if (bundle && bundle.startsWith('bundle_')) {
sentryTest.skip();
}

const url = await getLocalTestPath({ testDir: __dirname });

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

expect(eventData.logentry).toStrictEqual({
message: 'This is a log statement with %s and %s params',
params: ['first', 'second'],
});
});
Loading