Skip to content

Commit

Permalink
Merge branch 'develop' into lforst-attempt-fixing-flakey-e2e-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst authored Aug 5, 2024
2 parents 90636bc + c1052ab commit 3a05857
Show file tree
Hide file tree
Showing 60 changed files with 325 additions and 201 deletions.
39 changes: 37 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,49 @@
# Changelog

> [!IMPORTANT] Important
>
<!-- prettier-ignore-start -->
> [!IMPORTANT]
> If you are upgrading to the `8.x` versions of the SDK from `7.x` or below, make sure you follow our
> [migration guide](https://docs.sentry.io/platforms/javascript/migration/) first.
<!-- prettier-ignore-end -->
## Unreleased

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

## 8.23.0

### Important Changes

- **feat(cloudflare): Add Cloudflare D1 instrumentation (#13142)**

This release includes support for Cloudflare D1, Cloudflare's serverless SQL database. To instrument your Cloudflare D1
database, use the `instrumentD1WithSentry` method as follows:

```ts
// env.DB is the D1 DB binding configured in your `wrangler.toml`
const db = instrumentD1WithSentry(env.DB);
// Now you can use the database as usual
await db.prepare('SELECT * FROM table WHERE id = ?').bind(1).run();
```

### Other Changes

- feat(cloudflare): Allow users to pass handler to sentryPagesPlugin (#13192)
- feat(cloudflare): Instrument scheduled handler (#13114)
- feat(core): Add `getTraceData` function (#13134)
- feat(nestjs): Automatic instrumentation of nestjs interceptors before route execution (#13153)
- feat(nestjs): Automatic instrumentation of nestjs pipes (#13137)
- feat(nuxt): Filter out Nuxt build assets (#13148)
- feat(profiling): Attach sdk info to chunks (#13145)
- feat(solidstart): Add sentry `onBeforeResponse` middleware to enable distributed tracing (#13221)
- feat(solidstart): Filter out low quality transactions for build assets (#13222)
- fix(browser): Avoid showing browser extension error message in non-`window` global scopes (#13156)
- fix(feedback): Call dialog.close() in dialog close callbacks in `\_loadAndRenderDialog` (#13203)
- fix(nestjs): Inline Observable type to resolve missing 'rxjs' dependency (#13166)
- fix(nuxt): Detect pageload by adding flag in Vue router (#13171)
- fix(utils): Handle when requests get aborted in fetch instrumentation (#13202)
- ref(browser): Improve browserMetrics collection (#13062)

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

## 8.22.0
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-integration-tests",
"version": "8.22.0",
"version": "8.23.0",
"main": "index.js",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -43,7 +43,7 @@
"@babel/preset-typescript": "^7.16.7",
"@playwright/test": "^1.44.1",
"@sentry-internal/rrweb": "2.11.0",
"@sentry/browser": "8.22.0",
"@sentry/browser": "8.23.0",
"axios": "1.6.7",
"babel-loader": "^8.2.2",
"html-webpack-plugin": "^5.5.0",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/bundle-analyzer-scenarios/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/bundle-analyzer-scenarios",
"version": "8.22.0",
"version": "8.23.0",
"description": "Scenarios to test bundle analysis with",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/e2e-tests",
"version": "8.22.0",
"version": "8.23.0",
"license": "MIT",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/microservices": "^10.0.0",
"@nestjs/schedule": "^4.1.0",
"@nestjs/platform-express": "^10.0.0",
"@sentry/nestjs": "latest || *",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export class AppController {
return this.appService.testExpected500Exception(id);
}

@Get('test-expected-rpc-exception/:id')
async testExpectedRpcException(@Param('id') id: string) {
return this.appService.testExpectedRpcException(id);
}

@Get('test-span-decorator-async')
async testSpanDecoratorAsync() {
return { result: await this.appService.testSpanDecoratorAsync() };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
import { RpcException } from '@nestjs/microservices';
import { Cron, SchedulerRegistry } from '@nestjs/schedule';
import * as Sentry from '@sentry/nestjs';
import { SentryCron, SentryTraced } from '@sentry/nestjs';
Expand Down Expand Up @@ -38,6 +39,10 @@ export class AppService {
throw new HttpException(`This is an expected 500 exception with id ${id}`, HttpStatus.INTERNAL_SERVER_ERROR);
}

testExpectedRpcException(id: string) {
throw new RpcException(`This is an expected RPC exception with id ${id}`);
}

@SentryTraced('wait and return a string')
async wait() {
await new Promise(resolve => setTimeout(resolve, 500));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,28 @@ test('Does not send HttpExceptions to Sentry', async ({ baseURL }) => {

expect(errorEventOccurred).toBe(false);
});

test('Does not send RpcExceptions to Sentry', async ({ baseURL }) => {
let errorEventOccurred = false;

waitForError('nestjs-basic', event => {
if (!event.type && event.exception?.values?.[0]?.value === 'This is an expected RPC exception with id 123') {
errorEventOccurred = true;
}

return event?.transaction === 'GET /test-expected-rpc-exception/:id';
});

const transactionEventPromise = waitForTransaction('nestjs-basic', transactionEvent => {
return transactionEvent?.transaction === 'GET /test-expected-rpc-exception/:id';
});

const response = await fetch(`${baseURL}/test-expected-rpc-exception/123`);
expect(response.status).toBe(500);

await transactionEventPromise;

await new Promise(resolve => setTimeout(resolve, 10000));

expect(errorEventOccurred).toBe(false);
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/microservices": "^10.0.0",
"@nestjs/schedule": "^4.1.0",
"@nestjs/platform-express": "^10.0.0",
"@sentry/nestjs": "latest || *",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export class AppController {
return this.appService.testExpected500Exception(id);
}

@Get('test-expected-rpc-exception/:id')
async testExpectedRpcException(@Param('id') id: string) {
return this.appService.testExpectedRpcException(id);
}

@Get('test-span-decorator-async')
async testSpanDecoratorAsync() {
return { result: await this.appService.testSpanDecoratorAsync() };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
import { RpcException } from '@nestjs/microservices';
import { Cron, SchedulerRegistry } from '@nestjs/schedule';
import * as Sentry from '@sentry/nestjs';
import { SentryCron, SentryTraced } from '@sentry/nestjs';
Expand Down Expand Up @@ -38,6 +39,10 @@ export class AppService {
throw new HttpException(`This is an expected 500 exception with id ${id}`, HttpStatus.INTERNAL_SERVER_ERROR);
}

testExpectedRpcException(id: string) {
throw new RpcException(`This is an expected RPC exception with id ${id}`);
}

@SentryTraced('wait and return a string')
async wait() {
await new Promise(resolve => setTimeout(resolve, 500));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,28 @@ test('Does not send HttpExceptions to Sentry', async ({ baseURL }) => {

expect(errorEventOccurred).toBe(false);
});

test('Does not send RpcExceptions to Sentry', async ({ baseURL }) => {
let errorEventOccurred = false;

waitForError('node-nestjs-basic', event => {
if (!event.type && event.exception?.values?.[0]?.value === 'This is an expected RPC exception with id 123') {
errorEventOccurred = true;
}

return event?.transaction === 'GET /test-expected-rpc-exception/:id';
});

const transactionEventPromise = waitForTransaction('node-nestjs-basic', transactionEvent => {
return transactionEvent?.transaction === 'GET /test-expected-rpc-exception/:id';
});

const response = await fetch(`${baseURL}/test-expected-rpc-exception/123`);
expect(response.status).toBe(500);

await transactionEventPromise;

await new Promise(resolve => setTimeout(resolve, 10000));

expect(errorEventOccurred).toBe(false);
});
2 changes: 1 addition & 1 deletion dev-packages/external-contributor-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/external-contributor-gh-action",
"description": "An internal Github Action to add external contributors to the CHANGELOG.md file.",
"version": "8.22.0",
"version": "8.23.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
6 changes: 3 additions & 3 deletions dev-packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/node-integration-tests",
"version": "8.22.0",
"version": "8.23.0",
"license": "MIT",
"engines": {
"node": ">=14.18"
Expand Down Expand Up @@ -31,8 +31,8 @@
"@nestjs/core": "^10.3.3",
"@nestjs/platform-express": "^10.3.3",
"@prisma/client": "5.9.1",
"@sentry/node": "8.22.0",
"@sentry/types": "8.22.0",
"@sentry/node": "8.23.0",
"@sentry/types": "8.23.0",
"@types/mongodb": "^3.6.20",
"@types/mysql": "^2.15.21",
"@types/pg": "^8.6.5",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/overhead-metrics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "8.22.0",
"version": "8.23.0",
"name": "@sentry-internal/overhead-metrics",
"main": "index.js",
"author": "Sentry",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/rollup-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/rollup-utils",
"version": "8.22.0",
"version": "8.23.0",
"description": "Rollup utilities used at Sentry for the Sentry JavaScript SDK",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/rollup-utils",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/size-limit-gh-action/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sentry-internal/size-limit-gh-action",
"description": "An internal Github Action to compare the current size of a PR against the one on develop.",
"version": "8.22.0",
"version": "8.23.0",
"license": "MIT",
"engines": {
"node": ">=18"
Expand Down
6 changes: 3 additions & 3 deletions dev-packages/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"version": "8.22.0",
"version": "8.23.0",
"name": "@sentry-internal/test-utils",
"author": "Sentry",
"license": "MIT",
Expand Down Expand Up @@ -45,8 +45,8 @@
},
"devDependencies": {
"@playwright/test": "^1.44.1",
"@sentry/types": "8.22.0",
"@sentry/utils": "8.22.0"
"@sentry/types": "8.23.0",
"@sentry/utils": "8.23.0"
},
"volta": {
"extends": "../../package.json"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "8.22.0",
"version": "8.23.0",
"npmClient": "yarn"
}
10 changes: 5 additions & 5 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular",
"version": "8.22.0",
"version": "8.23.0",
"description": "Official Sentry SDK for Angular",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
Expand All @@ -21,10 +21,10 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "8.22.0",
"@sentry/core": "8.22.0",
"@sentry/types": "8.22.0",
"@sentry/utils": "8.22.0",
"@sentry/browser": "8.23.0",
"@sentry/core": "8.23.0",
"@sentry/types": "8.23.0",
"@sentry/utils": "8.23.0",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/astro",
"version": "8.22.0",
"version": "8.23.0",
"description": "Official Sentry SDK for Astro",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/astro",
Expand Down Expand Up @@ -56,11 +56,11 @@
"astro": ">=3.x || >=4.0.0-beta"
},
"dependencies": {
"@sentry/browser": "8.22.0",
"@sentry/core": "8.22.0",
"@sentry/node": "8.22.0",
"@sentry/types": "8.22.0",
"@sentry/utils": "8.22.0",
"@sentry/browser": "8.23.0",
"@sentry/core": "8.23.0",
"@sentry/node": "8.23.0",
"@sentry/types": "8.23.0",
"@sentry/utils": "8.23.0",
"@sentry/vite-plugin": "^2.20.1"
},
"devDependencies": {
Expand Down
10 changes: 5 additions & 5 deletions packages/aws-serverless/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/aws-serverless",
"version": "8.22.0",
"version": "8.23.0",
"description": "Official Sentry SDK for AWS Lambda and AWS Serverless Environments",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/serverless",
Expand Down Expand Up @@ -66,10 +66,10 @@
"dependencies": {
"@opentelemetry/instrumentation-aws-lambda": "0.43.0",
"@opentelemetry/instrumentation-aws-sdk": "0.43.1",
"@sentry/core": "8.22.0",
"@sentry/node": "8.22.0",
"@sentry/types": "8.22.0",
"@sentry/utils": "8.22.0",
"@sentry/core": "8.23.0",
"@sentry/node": "8.23.0",
"@sentry/types": "8.23.0",
"@sentry/utils": "8.23.0",
"@types/aws-lambda": "^8.10.62"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/browser-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry-internal/browser-utils",
"version": "8.22.0",
"version": "8.23.0",
"description": "Browser Utilities for all Sentry JavaScript SDKs",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser-utils",
Expand Down Expand Up @@ -39,9 +39,9 @@
"access": "public"
},
"dependencies": {
"@sentry/core": "8.22.0",
"@sentry/types": "8.22.0",
"@sentry/utils": "8.22.0"
"@sentry/core": "8.23.0",
"@sentry/types": "8.23.0",
"@sentry/utils": "8.23.0"
},
"scripts": {
"build": "run-p build:transpile build:types",
Expand Down
Loading

0 comments on commit 3a05857

Please sign in to comment.