Skip to content

meta(changelog): Update changelog for 7.99.0 #10405

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 41 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8e21feb
Merge pull request #10342 from getsentry/master
github-actions[bot] Jan 25, 2024
7da30a7
chore(biome): Ignore SvelteKit and NextJS build output directories (#…
Lms24 Jan 25, 2024
5aac3a6
feat(core): Deprecate `StartSpanOptions.origin` in favour of passing …
Lms24 Jan 25, 2024
cbccf51
ref(types): Add known attribute keys to `SpanAttributes` type (#10295)
Lms24 Jan 25, 2024
d64b798
feat(core): Add `afterAllSetup` hook for integrations (#10345)
mydea Jan 25, 2024
35b6b26
test(node): Add `mysql2` auto instrumentation test for `@sentry/node-…
timfish Jan 25, 2024
256b8be
test(node): Add mutation case to GraphQL OTEL integration tests. (#10…
onurtemizkan Jan 25, 2024
bd8d8bb
test(node): Add `pg` auto instrumentation test for `@sentry/node-expe…
timfish Jan 25, 2024
e0869ab
fix(deno): Call function if client is not setup (#10354)
AbhiPrasad Jan 25, 2024
2879478
feat(deno): Expose functional integrations to replace classes (#10355)
mydea Jan 25, 2024
adccbe6
feat(tracing): Expose new `browserTracingIntegration` (#10351)
mydea Jan 26, 2024
6b3f553
fix(core): Make `FunctionToString` integration use SETUP_CLIENTS weak…
AbhiPrasad Jan 26, 2024
427fa20
test(e2e): Add request instrumentation tests for Next.js 14 (#10367)
lforst Jan 26, 2024
3cc7057
ref(browser-integration-tests): Fix flake in interaction transaction …
Lms24 Jan 26, 2024
dd77951
fix(spotlight): Use unpatched http.request (#10369)
mydea Jan 26, 2024
9f9c51d
fix: Ensure `afterAllSetup` is called when using `addIntegration()` (…
mydea Jan 26, 2024
71a84ab
fix(core): Export `spanToTraceContext` function from span utils (#10364)
kammeph Jan 26, 2024
1f3a796
docs: Add docs on building the SDK (#10368)
mydea Jan 26, 2024
0612090
feat(remix): Export missing functions (#10385)
Lms24 Jan 29, 2024
8554dca
feat(core): Deprecate `Span.setHttpStatus` in favor of `setHttpStatus…
Lms24 Jan 29, 2024
2ce3e7d
fix(react): Fix attachReduxState option (#10381)
AleshaOleg Jan 29, 2024
51b0f5d
feat(core): Deprecate `spanStatusfromHttpCode` in favour of `getSpanS…
Lms24 Jan 29, 2024
b3af0dc
ref: Read propagation context off of scope and isolation scope when p…
lforst Jan 29, 2024
87ad0fe
test(node): Add `hapi` auto instrumentation test for `@sentry/node-ex…
timfish Jan 29, 2024
78c6a9d
test(e2e): Add Node SDK re-exports consistency e2e test (#10389)
Lms24 Jan 29, 2024
7dc9260
ref(tracing): Implement changes to new `browserTracingIntegration` (#…
mydea Jan 29, 2024
9690d7d
fix(tracing): Only create request span if there is active span (#10375)
AbhiPrasad Jan 29, 2024
ea85419
ref(serverless): Convert integrations to functional approach (#10329)
AbhiPrasad Jan 29, 2024
07a2264
feat(core): Read propagation context off scopes in `startSpan` APIs (…
lforst Jan 30, 2024
2267493
feat(remix): Add more missing `@sentry/node` re-exports (#10391)
Lms24 Jan 30, 2024
0605f17
feat(sveltekit): Add more missing `@sentry/node` re-exports (#10392)
Lms24 Jan 30, 2024
18c0a4f
feat(bun): Add missing `@sentry/node` re-exports (#10396)
Lms24 Jan 30, 2024
1fea339
feat(serverless): Add missing `@sentry/node` re-exports (#10390)
Lms24 Jan 30, 2024
1822af5
feat(core): Ensure `startSpan()` can handle spans that require parent…
mydea Jan 30, 2024
71b8ac1
feat(tracing): Export proper type for browser tracing (#10411)
mydea Jan 30, 2024
5b953b6
Update README.md
stephanie-anderson Jan 30, 2024
9fe67aa
fix: Fork scope and keep async context within `startSpan` and `startS…
lforst Jan 30, 2024
689646c
Update README.md
stephanie-anderson Jan 30, 2024
2195ce6
ref(tracing): Require to pass client to `startBrowserTracing*Span` ut…
mydea Jan 30, 2024
527e278
Update README.md
stephanie-anderson Jan 30, 2024
818d959
meta(changelog): Update changelog for 7.99.0
AbhiPrasad Jan 29, 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
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ jobs:
'generic-ts3.8',
'node-experimental-fastify-app',
'node-hapi-app',
'node-exports-test-app',
]
build-command:
- false
Expand Down Expand Up @@ -946,6 +947,9 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: 'dev-packages/e2e-tests/package.json'
- name: Set up Bun
if: matrix.test-application == 'node-exports-test-app'
uses: oven-sh/setup-bun@v1
- name: Restore caches
uses: ./.github/actions/restore-cache
env:
Expand Down
7 changes: 7 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ module.exports = [
gzip: true,
limit: '35 KB',
},
{
name: '@sentry/browser (incl. browserTracingIntegration) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
import: '{ init, browserTracingIntegration }',
gzip: true,
limit: '35 KB',
},
{
name: '@sentry/browser (incl. Feedback) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
Expand Down
41 changes: 39 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@

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

## 7.99.0

### Important Changes

#### Deprecations

This release includes some deprecations for span related methods and integrations in our Deno SDK, `@sentry/deno`. For
more details please look at our
[migration guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md).

- feat(core): Deprecate `Span.setHttpStatus` in favor of `setHttpStatus` (#10268)
- feat(core): Deprecate `spanStatusfromHttpCode` in favour of `getSpanStatusFromHttpCode` (#10361)
- feat(core): Deprecate `StartSpanOptions.origin` in favour of passing attribute (#10274)
- feat(deno): Expose functional integrations to replace classes (#10355)

### Other Changes

- feat(bun): Add missing `@sentry/node` re-exports (#10396)
- feat(core): Add `afterAllSetup` hook for integrations (#10345)
- feat(core): Ensure `startSpan()` can handle spans that require parent (#10386)
- feat(core): Read propagation context off scopes in `startSpan` APIs (#10300)
- feat(remix): Export missing `@sentry/node` functions (#10385, #10391)
- feat(serverless): Add missing `@sentry/node` re-exports (#10390)
- feat(sveltekit): Add more missing `@sentry/node` re-exports (#10392)
- feat(tracing): Export proper type for browser tracing (#10411)
- feat(tracing): Expose new `browserTracingIntegration` (#10351)
- fix: Ensure `afterAllSetup` is called when using `addIntegration()` (#10372)
- fix(core): Export `spanToTraceContext` function from span utils (#10364)
- fix(core): Make `FunctionToString` integration use SETUP_CLIENTS weakmap (#10358)
- fix(deno): Call function if client is not setup (#10354)
- fix(react): Fix attachReduxState option (#10381)
- fix(spotlight): Use unpatched http.request (#10369)
- fix(tracing): Only create request span if there is active span (#10375)
- ref: Read propagation context off of scope and isolation scope when propagating and applying trace context (#10297)

Work in this release contributed by @AleshaOleg. Thank you for your contribution!

## 7.98.0

This release primarily fixes some type declaration errors:
Expand All @@ -20,7 +57,7 @@ Note: The 7.96.0 release was incomplete. This release is partially encompassing

## 7.96.0

Note: This release was incomplete. Not all Sentry SDK packages were released for this version. Please upgrade to 7.97.0
Note: This release was incomplete. Not all Sentry SDK packages were released for this version. Please upgrade to 7.98.0
directly.

### Important Changes
Expand Down Expand Up @@ -1103,7 +1140,7 @@ finished. This is useful for event emitters or similar.
function middleware(_req, res, next) {
return Sentry.startSpanManual({ name: 'middleware' }, (span, finish) => {
res.once('finish', () => {
span?.setHttpStatus(res.status);
setHttpStatus(span, res.status);
finish();
});
return next();
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ able to use it. From the top level of the repo, there are three commands availab
dependencies (`utils`, `core`, `browser`, etc), and all packages which depend on it (currently `gatsby` and `nextjs`))
- `yarn build:dev:watch`, which runs `yarn build:dev` in watch mode (recommended)

You can also run a production build via `yarn build`, which will build everything except for the tarballs for publishing
to NPM. You can use this if you want to bundle Sentry yourself. The build output can be found in the packages `build/`
folder, e.g. `packages/browser/build`. Bundled files can be found in `packages/browser/build/bundles`. Note that there
are no guarantees about the produced file names etc., so make sure to double check which files are generated after
upgrading.

## Testing SDK Packages Locally

To test local versions of SDK packages, for instance in test projects, you have a couple of options:
Expand Down
7 changes: 5 additions & 2 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ The following list shows how integrations should be migrated:
| `new RewriteFrames()` | `rewriteFramesIntegration()` | `@sentry/integrations` |
| `new SessionTiming()` | `sessionTimingIntegration()` | `@sentry/integrations` |
| `new HttpClient()` | `httpClientIntegration()` | `@sentry/integrations` |
| `new ContextLines()` | `contextLinesIntegration()` | `@sentry/browser` |
| `new ContextLines()` | `contextLinesIntegration()` | `@sentry/browser`, `@sentry/deno` |
| `new Breadcrumbs()` | `breadcrumbsIntegration()` | `@sentry/browser`, `@sentry/deno` |
| `new GlobalHandlers()` | `globalHandlersIntegration()` | `@sentry/browser` |
| `new GlobalHandlers()` | `globalHandlersIntegration()` | `@sentry/browser` , `@sentry/deno` |
| `new HttpContext()` | `httpContextIntegration()` | `@sentry/browser` |
| `new TryCatch()` | `browserApiErrorsIntegration()` | `@sentry/browser`, `@sentry/deno` |
| `new VueIntegration()` | `vueIntegration()` | `@sentry/vue` |
| `new DenoContext()` | `denoContextIntegration()` | `@sentry/deno` |
| `new DenoCron()` | `denoCronIntegration()` | `@sentry/deno` |
| `new NormalizePaths()` | `normalizePathsIntegration()` | `@sentry/deno` |

## Deprecate `hub.bindClient()` and `makeMain()`

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ convenient interface and improved consistency between various JavaScript environ
- [Supported Platforms](#supported-platforms)
- [Installation and Usage](#installation-and-usage)
- [Other Packages](#other-packages)
- [Bug Bounty Program](#bug-bounty-program)

## Supported Platforms

Expand Down Expand Up @@ -104,3 +105,12 @@ below:
utility functions useful for various SDKs.
- [`@sentry/types`](https://github.com/getsentry/sentry-javascript/tree/master/packages/types): Types used in all
packages.

## Bug Bounty Program

Our bug bounty program aims to improve the security of our open source projects by encouraging the community to identify and report potential security vulnerabilities. Your reward will depend on the severity of the identified vulnerability.

Our program is currently running on an invitation basis. If you're interested in participating, please send us an email to [email protected] and tell us, that you are interested in auditing this repository.

For more details, please have a look at https://sentry.io/security/#vulnerability-disclosure.

5 changes: 4 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@
"dev-packages/browser-integration-tests/suites/**/*.json",
"dev-packages/browser-integration-tests/loader-suites/**/*.js",
"dev-packages/browser-integration-tests/suites/stacktraces/**/*.js",
".next/**/*",
"**/fixtures/*/*.json",
"**/*.min.js"
"**/*.min.js",
".next/**",
".svelte-kit/**"
]
},
"javascript": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

// Replay should not actually work, but still not error out
window.Replay = new Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
});

Sentry.init({
dsn: 'https://[email protected]/1337',
sampleRate: 1,
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 0.0,
integrations: [window.Replay],
});

// Ensure none of these break
window.Replay.start();
window.Replay.stop();
window.Replay.flush();
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<button onclick="console.log('Test log')">Click me</button>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { expect } from '@playwright/test';

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

sentryTest(
'exports a shim replayIntegration integration for non-replay bundles',
async ({ getLocalTestPath, page, forceFlushReplay }) => {
const bundle = process.env.PW_BUNDLE;

if (!bundle || !bundle.startsWith('bundle_') || bundle.includes('replay')) {
sentryTest.skip();
}

const consoleMessages: string[] = [];
page.on('console', msg => consoleMessages.push(msg.text()));

let requestCount = 0;
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
requestCount++;
return route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify({ id: 'test-id' }),
});
});

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

await page.goto(url);
await forceFlushReplay();

expect(requestCount).toBe(0);
expect(consoleMessages).toEqual(['You are using new Replay() even though this bundle does not include replay.']);
},
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [Sentry.browserTracingIntegration({ idleTimeout: 9000 })],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
document.getElementById('go-background').addEventListener('click', () => {
Object.defineProperty(document, 'hidden', { value: true, writable: true });
const ev = document.createEvent('Event');
ev.initEvent('visibilitychange');
document.dispatchEvent(ev);
});

document.getElementById('start-transaction').addEventListener('click', () => {
window.transaction = Sentry.startTransaction({ name: 'test-transaction' });
Sentry.getCurrentHub().configureScope(scope => scope.setSpan(window.transaction));
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<button id="start-transaction">Start Transaction</button>
<button id="go-background">New Tab</button>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import type { JSHandle } from '@playwright/test';
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

async function getPropertyValue(handle: JSHandle, prop: string) {
return (await handle.getProperty(prop))?.jsonValue();
}

sentryTest('should finish a custom transaction when the page goes background', async ({ getLocalTestPath, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

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

const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
expect(pageloadTransaction).toBeDefined();

await page.locator('#start-transaction').click();
const transactionHandle = await page.evaluateHandle('window.transaction');

const id_before = await getPropertyValue(transactionHandle, 'span_id');
const name_before = await getPropertyValue(transactionHandle, 'name');
const status_before = await getPropertyValue(transactionHandle, 'status');
const tags_before = await getPropertyValue(transactionHandle, 'tags');

expect(name_before).toBe('test-transaction');
expect(status_before).toBeUndefined();
expect(tags_before).toStrictEqual({});

await page.locator('#go-background').click();

const id_after = await getPropertyValue(transactionHandle, 'span_id');
const name_after = await getPropertyValue(transactionHandle, 'name');
const status_after = await getPropertyValue(transactionHandle, 'status');
const tags_after = await getPropertyValue(transactionHandle, 'tags');

expect(id_before).toBe(id_after);
expect(name_after).toBe(name_before);
expect(status_after).toBe('cancelled');
expect(tags_after).toStrictEqual({ visibilitychange: 'document.hidden' });
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
document.getElementById('go-background').addEventListener('click', () => {
setTimeout(() => {
Object.defineProperty(document, 'hidden', { value: true, writable: true });
const ev = document.createEvent('Event');
ev.initEvent('visibilitychange');
document.dispatchEvent(ev);
}, 250);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<button id="go-background">New Tab</button>
</body>
</html>
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 { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';

sentryTest('should finish pageload transaction when the page goes background', async ({ getLocalTestPath, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}
const url = await getLocalTestPath({ testDir: __dirname });

await page.goto(url);
await page.locator('#go-background').click();

const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page);

expect(pageloadTransaction.contexts?.trace?.op).toBe('pageload');
expect(pageloadTransaction.contexts?.trace?.status).toBe('cancelled');
expect(pageloadTransaction.contexts?.trace?.tags).toMatchObject({
visibilitychange: 'document.hidden',
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [
Sentry.browserTracingIntegration({
idleTimeout: 1000,
_experiments: {
enableHTTPTimings: true,
},
}),
],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fetch('http://example.com/0').then(fetch('http://example.com/1').then(fetch('http://example.com/2')));
Loading