Skip to content

Commit

Permalink
Merge pull request #7666 from getsentry/prepare-release/7.46.0
Browse files Browse the repository at this point in the history
meta(changelog): Update changelog for 7.46.0
  • Loading branch information
AbhiPrasad committed Mar 30, 2023
2 parents ca704ef + 5e288f5 commit eb898f5
Show file tree
Hide file tree
Showing 293 changed files with 7,158 additions and 3,705 deletions.
4 changes: 4 additions & 0 deletions .github/codeql/codeql-config.yml
@@ -0,0 +1,4 @@
paths-ignore:
# Our tsconfig files contain comments, which CodeQL complains about
- '**/tsconfig.json'
- '**/tsconfig.*.json'
23 changes: 9 additions & 14 deletions .github/workflows/build.yml
Expand Up @@ -185,7 +185,7 @@ jobs:
name: Build
needs: [job_get_metadata, job_install_deps]
runs-on: ubuntu-20.04
timeout-minutes: 20
timeout-minutes: 30
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v3
Expand Down Expand Up @@ -371,7 +371,6 @@ jobs:
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/integrations/build/bundles/**
${{ github.workspace }}/packages/tracing/build/bundles/**
${{ github.workspace }}/packages/replay/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
Expand Down Expand Up @@ -482,7 +481,7 @@ jobs:
yarn test:integration
job_browser_playwright_tests:
name: Playwright (${{ matrix.bundle }})${{ (matrix.tracing_only && ' tracing only') || '' }} Tests
name: Playwright (${{ matrix.bundle }}) Tests
needs: [job_get_metadata, job_build]
if: needs.job_get_metadata.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-20.04
Expand All @@ -499,16 +498,13 @@ jobs:
- bundle_es6_min
- bundle_replay_es6
- bundle_replay_es6_min
tracing_only:
- true
- false
exclude:
# `tracing_only` only makes a difference for bundles - tests of the esm and cjs builds always include the
# tracing tests
- bundle: esm
tracing_only: false
- bundle: cjs
tracing_only: false
- bundle_tracing_es5
- bundle_tracing_es5_min
- bundle_tracing_es6
- bundle_tracing_es6_min
- bundle_tracing_replay_es6
- bundle_tracing_replay_es6_min

steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v3
Expand Down Expand Up @@ -543,7 +539,6 @@ jobs:
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
PW_TRACING_ONLY: ${{ matrix.tracing_only }}
run: |
cd packages/browser-integration-tests
yarn test:ci
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -50,6 +50,7 @@ jobs:
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
config-file: ./.github/codeql/codeql-config.yml
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
Expand Down
6 changes: 3 additions & 3 deletions .size-limit.js
Expand Up @@ -53,13 +53,13 @@ module.exports = [
},
{
name: '@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)',
path: 'packages/tracing/build/bundles/bundle.tracing.es5.min.js',
path: 'packages/browser/build/bundles/bundle.tracing.es5.min.js',
gzip: true,
limit: '37 KB',
},
{
name: '@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)',
path: 'packages/tracing/build/bundles/bundle.tracing.min.js',
path: 'packages/browser/build/bundles/bundle.tracing.min.js',
gzip: true,
limit: '35 KB',
},
Expand All @@ -80,7 +80,7 @@ module.exports = [
},
{
name: '@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified)',
path: 'packages/tracing/build/bundles/bundle.tracing.replay.min.js',
path: 'packages/browser/build/bundles/bundle.tracing.replay.min.js',
gzip: true,
limit: '80 KB',
},
Expand Down
76 changes: 76 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,82 @@

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

## 7.46.0

### Important Changes

- **feat(sveltekit)**: Add Performance Monitoring for SvelteKit
- feat(sveltekit): Add meta tag for backend -> frontend (#7574)
- fix(sveltekit): Explicitly export Node SDK exports (#7644)
- fix(sveltekit): Handle nested server calls in `sentryHandle` (#7598)
- ref(sveltekit): Split up universal and server load wrappers (#7652)

This release adds support for Performance Monitoring in our SvelteKit SDK for the client/server. We've also changed how you should initialize your SDK. Please read our updated [SvelteKit README instructions](./packages/sveltekit/README.md) for more details.

- **feat(core)**: Add `ignoreTransactions` option (#7594)

You can now easily filter out certain transactions from being sent to Sentry based on their name.

```ts
Sentry.init({
ignoreTransactions: ['/api/healthcheck', '/ping'],
})
```

- **feat(node)**: Undici integration (#7582)
- feat(nextjs): Add Undici integration automatically (#7648)
- feat(sveltekit): Add Undici integration by default (#7650)

We've added an integration that automatically instruments [Undici](https://github.com/nodejs/undici) and Node server side fetch. This supports Undici `v4.7.0` or higher and requires Node `v16.7.0` or higher. After adding the integration outgoing requests made by Undici will have associated spans and breadcrumbs in Sentry.

```ts
Sentry.init({
integrations: [new Sentry.Integrations.Undici()],
})
```

In our Next.js and SvelteKit SDKs, this integration is automatically added.

- **feat(node)**: Add Sentry tRPC middleware (#7511)

We've added a new middleware for [trpc](https://trpc.io/) that automatically adds TRPC information to Sentry transactions. This middleware is meant to be used in combination with a Sentry server integration (Next.js, Express, etc).

```ts
import { initTRPC } from '@trpc/server';
import * as Sentry from '@sentry/node';

const t = initTRPC.context().create();
const sentryMiddleware = t.middleware(
Sentry.Handlers.trpcMiddleware({
attachRpcInput: true,
}),
);

const sentrifiedProcedure = t.procedure.use(sentryMiddleware);
```

- **fix(node)**: Convert debugging code to callbacks to fix memory leak in `LocalVariables` integration (#7637)

This fixes a memory leak in the opt-in [`LocalVariables` integration](https://blog.sentry.io/2023/02/01/local-variables-for-nodejs-in-sentry/), which adds local variables to the stacktraces sent to Sentry. The minimum recommended version to use the `LocalVariables` is now `7.46.0`.

### Additional Features and Fixes

- feat(node): Auto discovery only returns integrations where dependency loads (#7603)
- feat(node): Sanitize URLs in Span descriptions and breadcrumbs (PII) (#7667)
- feat(replay): Add `responseStatus`, `decodedBodySize` to perf entries (#7613)
- feat(replay): Add experiment to capture request/response bodies (#7589)
- feat(replay): Capture replay mutation breadcrumbs & add experiment (#7568)
- feat(tracing): Ensure `pageload` transaction starts at timeOrigin (#7632)
- fix(core): Remove `abs_path` from stack trace (reverting #7167) (#7623)
- fix(nextjs): Add loading component type to server component wrapping (#7639)
- fix(nextjs): Don't report `NEXT_NOT_FOUND` and `NEXT_REDIRECT` errors (#7642)
- fix(nextjs): Rewrite `abs_path` frames (#7619)
- fix(nextjs): Show errors and warnings only once during build (#7651)
- fix(nextjs): Use Next.js internal AsyncStorage (#7630)
- fix(nextjs): Gracefully handle undefined `beforeFiles` in rewrites (#7649)

Work in this release contributed by @aldenquimby and @bertho-zero. Thank you for your contributions!

## 7.45.0

- build(cdn): Ensure ES5 bundles do not use non-ES5 code (#7550)
Expand Down
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1,3 @@
packages/replay @getsentry/replay-sdk
packages/replay-worker @getsentry/replay-sdk
packages/browser-integration-tests/suites/replay @getsentry/replay-sdk
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -110,7 +110,6 @@
"rollup-plugin-cleanup": "3.2.1",
"rollup-plugin-license": "^2.6.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"sinon": "^7.3.2",
"size-limit": "^4.5.5",
"ts-jest": "^27.1.4",
Expand Down
15 changes: 7 additions & 8 deletions packages/angular-ivy/README.md
Expand Up @@ -80,26 +80,25 @@ see `ErrorHandlerOptions` interface in `src/errorhandler.ts`.

### Tracing

`@sentry/angular-ivy` exports a Trace Service, Directive and Decorators that leverage the `@sentry/tracing` Tracing
integration to add Angular related spans to transactions. If the Tracing integration is not enabled, this functionality
will not work. The service itself tracks route changes and durations, where directive and decorators are tracking
components initializations.
`@sentry/angular-ivy` exports a Trace Service, Directive and Decorators that leverage the tracing features to add
Angular-related spans to transactions. If tracing is not enabled, this functionality will not work. The SDK's
`TraceService` itself tracks route changes and durations, while directive and decorators are tracking components
initializations.

#### Install

Registering a Trace Service is a 3-step process.

1. Register and configure the `BrowserTracing` integration from `@sentry/tracing`, including custom Angular routing
1. Register and configure the `BrowserTracing` integration, including custom Angular routing
instrumentation:

```javascript
import { init, instrumentAngularRouting } from '@sentry/angular-ivy';
import { Integrations as TracingIntegrations } from '@sentry/tracing';
import { init, instrumentAngularRouting, BrowserTracing } from '@sentry/angular-ivy';

init({
dsn: '__DSN__',
integrations: [
new TracingIntegrations.BrowserTracing({
new BrowserTracing({
tracingOrigins: ['localhost', 'https://yourserver.io/api'],
routingInstrumentation: instrumentAngularRouting,
}),
Expand Down
13 changes: 6 additions & 7 deletions packages/angular/README.md
Expand Up @@ -76,26 +76,25 @@ see `ErrorHandlerOptions` interface in `src/errorhandler.ts`.

### Tracing

`@sentry/angular` exports a Trace Service, Directive and Decorators that leverage the `@sentry/tracing` Tracing
integration to add Angular related spans to transactions. If the Tracing integration is not enabled, this functionality
will not work. The service itself tracks route changes and durations, where directive and decorators are tracking
`@sentry/angular` exports a Trace Service, Directive and Decorators that leverage the tracing
features to add Angular-related spans to transactions. If tracing is not enabled, this functionality
will not work. The SDK's `TraceService` itself tracks route changes and durations, while directive and decorators are tracking
components initializations.

#### Install

Registering a Trace Service is a 3-step process.

1. Register and configure the `BrowserTracing` integration from `@sentry/tracing`, including custom Angular routing
1. Register and configure the `BrowserTracing` integration, including custom Angular routing
instrumentation:

```javascript
import { init, instrumentAngularRouting } from '@sentry/angular';
import { Integrations as TracingIntegrations } from '@sentry/tracing';
import { init, instrumentAngularRouting, BrowserTracing } from '@sentry/angular';

init({
dsn: '__DSN__',
integrations: [
new TracingIntegrations.BrowserTracing({
new BrowserTracing({
tracingOrigins: ['localhost', 'https://yourserver.io/api'],
routingInstrumentation: instrumentAngularRouting,
}),
Expand Down
8 changes: 0 additions & 8 deletions packages/angular/test/tsconfig.json

This file was deleted.

6 changes: 6 additions & 0 deletions packages/browser-integration-tests/package.json
Expand Up @@ -25,6 +25,12 @@
"test:bundle:es6:min": "PW_BUNDLE=bundle_es6_min yarn test",
"test:bundle:replay:es6": "PW_BUNDLE=bundle_replay_es6 yarn test",
"test:bundle:replay:es6:min": "PW_BUNDLE=bundle_replay_es6_min yarn test",
"test:bundle:tracing:es5": "PW_BUNDLE=bundle_tracing_es5 yarn test",
"test:bundle:tracing:es5:min": "PW_BUNDLE=bundle_tracing_es5_min yarn test",
"test:bundle:tracing:es6": "PW_BUNDLE=bundle_tracing_es6 yarn test",
"test:bundle:tracing:es6:min": "PW_BUNDLE=bundle_tracing_es6_min yarn test",
"test:bundle:tracing:replay:es6": "PW_BUNDLE=bundle_tracing_replay_es6 yarn test",
"test:bundle:tracing:replay:es6:min": "PW_BUNDLE=bundle_tracing_replay_es6_min yarn test",
"test:cjs": "PW_BUNDLE=cjs yarn test",
"test:esm": "PW_BUNDLE=esm yarn test",
"test:ci": "playwright test ./suites --browser='all' --reporter='line'",
Expand Down
@@ -1,30 +1,35 @@
const transaction = Sentry.startTransaction({ name: 'test_transaction_1' });
const span_1 = transaction.startChild({
op: 'span_1',
data: {
foo: 'bar',
baz: [1, 2, 3],
},
});
for (let i = 0; i < 2000; i++);
async function run() {
const transaction = Sentry.startTransaction({ name: 'test_transaction_1' });
const span_1 = transaction.startChild({
op: 'span_1',
data: {
foo: 'bar',
baz: [1, 2, 3],
},
});

// span_1 finishes
span_1.finish();
await new Promise(resolve => setTimeout(resolve, 1));

// span_2 doesn't finish
const span_2 = transaction.startChild({ op: 'span_2' });
for (let i = 0; i < 4000; i++);
// span_1 finishes
span_1.finish();

const span_3 = transaction.startChild({ op: 'span_3' });
for (let i = 0; i < 4000; i++);
// span_2 doesn't finish
const span_2 = transaction.startChild({ op: 'span_2' });
await new Promise(resolve => setTimeout(resolve, 1));

// span_4 is the child of span_3 but doesn't finish.
const span_4 = span_3.startChild({ op: 'span_4', data: { qux: 'quux' } });
const span_3 = transaction.startChild({ op: 'span_3' });
await new Promise(resolve => setTimeout(resolve, 1));

// span_5 is another child of span_3 but finishes.
const span_5 = span_3.startChild({ op: 'span_5' }).finish();
// span_4 is the child of span_3 but doesn't finish.
const span_4 = span_3.startChild({ op: 'span_4', data: { qux: 'quux' } });

// span_3 also finishes
span_3.finish();
// span_5 is another child of span_3 but finishes.
const span_5 = span_3.startChild({ op: 'span_5' }).finish();

transaction.finish();
// span_3 also finishes
span_3.finish();

transaction.finish();
}

run();
Expand Up @@ -2,9 +2,13 @@ import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest('should report a transaction in an envelope', async ({ getLocalTestPath, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

Expand All @@ -13,6 +17,10 @@ sentryTest('should report a transaction in an envelope', async ({ getLocalTestPa
});

sentryTest('should report finished spans as children of the root transaction', async ({ getLocalTestPath, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestPath({ testDir: __dirname });
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);

Expand Down
Expand Up @@ -2,9 +2,13 @@ import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest('should be able to handle circular data', async ({ getLocalTestPath, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestPath({ testDir: __dirname });
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);

Expand Down
Expand Up @@ -2,9 +2,13 @@ import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest('should attach measurement to transaction', async ({ getLocalTestPath, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestPath({ testDir: __dirname });
const event = await getFirstSentryEnvelopeRequest<Event>(page, url);

Expand Down

0 comments on commit eb898f5

Please sign in to comment.