Skip to content

Commit

Permalink
Merge pull request #13770 from getsentry/prepare-release/8.32.0
Browse files Browse the repository at this point in the history
meta(changelog): Update changelog for 8.32.0
  • Loading branch information
chargome authored Sep 25, 2024
2 parents d4f95c8 + 0a21708 commit ae901c3
Show file tree
Hide file tree
Showing 98 changed files with 1,901 additions and 458 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ jobs:
'node-express-cjs-preload',
'node-otel-sdk-node',
'node-otel-custom-sampler',
'node-otel-without-tracing',
'ember-classic',
'ember-embroider',
'nextjs-app-dir',
Expand Down Expand Up @@ -923,6 +924,7 @@ jobs:
'nestjs-distributed-tracing',
'nestjs-with-submodules',
'nestjs-with-submodules-decorator',
'nestjs-basic-with-graphql',
'nestjs-graphql',
'node-exports-test-app',
'node-koa',
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ local.log
.rpt2_cache

lint-results.json
trace.zip

# legacy
tmp.js
Expand All @@ -58,3 +59,6 @@ packages/deno/lib.deno.d.ts

# gatsby
packages/gatsby/gatsby-node.d.ts

# intellij
*.iml
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,41 @@

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

## 8.32.0

### Important Changes

- **ref(browser): Move navigation span descriptions into op
([#13527](https://github.com/getsentry/sentry-javascript/pull/13527))**

Moves the description of navigation related browser spans into the op, e.g. browser - cache -> browser.cache and sets
the description to the performanceEntry objects' names (in this context it is the URL of the page).

- **feat(node): Add amqplibIntegration ([#13714](https://github.com/getsentry/sentry-javascript/pull/13714))**

- **feat(nestjs): Add `SentryGlobalGenericFilter` and allow specifying application ref in global filter
([#13673](https://github.com/getsentry/sentry-javascript/pull/13673))**

Adds a `SentryGlobalGenericFilter` that filters both graphql and http exceptions depending on the context.

- **feat: Set log level for Fetch/XHR breadcrumbs based on status code
([#13711](https://github.com/getsentry/sentry-javascript/pull/13711))**

Sets log levels in breadcrumbs for 5xx to error and 4xx to warning.

### Other Changes

- chore(nextjs): Bump rollup to 3.29.5 ([#13761](https://github.com/getsentry/sentry-javascript/pull/13761))
- fix(core): Remove `sampled` flag from dynamic sampling context in Tracing without Performance mode
([#13753](https://github.com/getsentry/sentry-javascript/pull/13753))
- fix(node): Ensure node-fetch does not emit spans without tracing
([#13765](https://github.com/getsentry/sentry-javascript/pull/13765))
- fix(nuxt): Use Nuxt error hooks instead of errorHandler to prevent 500
([#13748](https://github.com/getsentry/sentry-javascript/pull/13748))
- fix(test): Unflake LCP test ([#13741](https://github.com/getsentry/sentry-javascript/pull/13741))

Work in this release was contributed by @Zen-cronic and @Sjoertjuh. Thank you for your contributions!

## 8.31.0

### Important Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fetch('http://sentry-test.io/foo').then(() => {
Sentry.captureException('test error');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest('captures Breadcrumb with log level for 4xx response code', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('**/foo', async route => {
await route.fulfill({
status: 404,
contentType: 'text/plain',
body: 'Not Found!',
});
});

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

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

expect(eventData?.breadcrumbs?.length).toBe(1);
expect(eventData!.breadcrumbs![0]).toEqual({
timestamp: expect.any(Number),
category: 'fetch',
type: 'http',
data: {
method: 'GET',
status_code: 404,
url: 'http://sentry-test.io/foo',
},
level: 'warning',
});

await page.route('**/foo', async route => {
await route.fulfill({
status: 500,
contentType: 'text/plain',
body: 'Internal Server Error',
});
});
});

sentryTest('captures Breadcrumb with log level for 5xx response code', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('**/foo', async route => {
await route.fulfill({
status: 500,
contentType: 'text/plain',
body: 'Internal Server Error',
});
});

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

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

expect(eventData?.breadcrumbs?.length).toBe(1);
expect(eventData!.breadcrumbs![0]).toEqual({
timestamp: expect.any(Number),
category: 'fetch',
type: 'http',
data: {
method: 'GET',
status_code: 500,
url: 'http://sentry-test.io/foo',
},
level: 'error',
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const xhr = new XMLHttpRequest();

xhr.open('GET', 'http://sentry-test.io/foo');
xhr.send();

xhr.addEventListener('readystatechange', function () {
if (xhr.readyState === 4) {
Sentry.captureException('test error');
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { expect } from '@playwright/test';
import type { Event } from '@sentry/types';

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

sentryTest('captures Breadcrumb with log level for 4xx response code', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('**/foo', async route => {
await route.fulfill({
status: 404,
contentType: 'text/plain',
body: 'Not Found!',
});
});

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

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

expect(eventData?.breadcrumbs?.length).toBe(1);
expect(eventData!.breadcrumbs![0]).toEqual({
timestamp: expect.any(Number),
category: 'xhr',
type: 'http',
data: {
method: 'GET',
status_code: 404,
url: 'http://sentry-test.io/foo',
},
level: 'warning',
});

await page.route('**/foo', async route => {
await route.fulfill({
status: 500,
contentType: 'text/plain',
body: 'Internal Server Error',
});
});
});

sentryTest('captures Breadcrumb with log level for 5xx response code', async ({ getLocalTestUrl, page }) => {
const url = await getLocalTestUrl({ testDir: __dirname });

await page.route('**/foo', async route => {
await route.fulfill({
status: 500,
contentType: 'text/plain',
body: 'Internal Server Error',
});
});

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

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

expect(eventData?.breadcrumbs?.length).toBe(1);
expect(eventData!.breadcrumbs![0]).toEqual({
timestamp: expect.any(Number),
category: 'xhr',
type: 'http',
data: {
method: 'GET',
status_code: 500,
url: 'http://sentry-test.io/foo',
},
level: 'error',
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,39 @@ sentryTest(
);

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

const [eventData] = await Promise.all([
getFirstSentryEnvelopeRequest<Event>(page),
page.goto(url),
page.click('button'),
page.locator('button').click(),
]);

expect(eventData.measurements).toBeDefined();
expect(eventData.measurements?.lcp?.value).toBeDefined();

expect(eventData.contexts?.trace?.data?.['lcp.element']).toBe('body > img');
expect(eventData.contexts?.trace?.data?.['lcp.size']).toBe(107400);
expect(eventData.contexts?.trace?.data?.['lcp.url']).toBe('https://example.com/path/to/image.png');
// This should be body > img, but it can be flakey as sometimes it will report
// the button as LCP.
expect(eventData.contexts?.trace?.data?.['lcp.element'].startsWith('body >')).toBe(true);

// Working around flakiness
// Only testing this when the LCP element is an image, not a button
if (eventData.contexts?.trace?.data?.['lcp.element'] === 'body > img') {
expect(eventData.contexts?.trace?.data?.['lcp.size']).toBe(107400);

const lcp = await (await page.waitForFunction('window._LCP')).jsonValue();
const lcp2 = await (await page.waitForFunction('window._LCP2')).jsonValue();
const lcp3 = await page.evaluate('window._LCP3');
const lcp = await (await page.waitForFunction('window._LCP')).jsonValue();
const lcp2 = await (await page.waitForFunction('window._LCP2')).jsonValue();
const lcp3 = await page.evaluate('window._LCP3');

expect(lcp).toEqual(107400);
expect(lcp2).toEqual(107400);
// this has not been triggered yet
expect(lcp3).toEqual(undefined);
expect(lcp).toEqual(107400);
expect(lcp2).toEqual(107400);
// this has not been triggered yet
expect(lcp3).toEqual(undefined);

// Adding a handler after LCP is completed still triggers the handler
await page.evaluate('window.ADD_HANDLER()');
const lcp3_2 = await (await page.waitForFunction('window._LCP3')).jsonValue();
// Adding a handler after LCP is completed still triggers the handler
await page.evaluate('window.ADD_HANDLER()');
const lcp3_2 = await (await page.waitForFunction('window._LCP3')).jsonValue();

expect(lcp3_2).toEqual(107400);
expect(lcp3_2).toEqual(107400);
}
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
const url = await getLocalTestPath({ testDir: __dirname });

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const browserSpans = eventData.spans?.filter(({ op }) => op === 'browser');
const browserSpans = eventData.spans?.filter(({ op }) => op?.startsWith('browser'));

// Spans `domContentLoadedEvent`, `connect`, `cache` and `DNS` are not
// always inside `pageload` transaction.
Expand All @@ -21,7 +21,8 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
['loadEvent', 'request', 'response'].forEach(eventDesc =>
expect(browserSpans).toContainEqual(
expect.objectContaining({
description: eventDesc,
op: `browser.${eventDesc}`,
description: page.url(),
parent_span_id: eventData.contexts?.trace?.span_id,
}),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
const url = await getLocalTestPath({ testDir: __dirname });

const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
const browserSpans = eventData.spans?.filter(({ op }) => op === 'browser');
const browserSpans = eventData.spans?.filter(({ op }) => op?.startsWith('browser'));

// Spans `domContentLoadedEvent`, `connect`, `cache` and `DNS` are not
// always inside `pageload` transaction.
expect(browserSpans?.length).toBeGreaterThanOrEqual(4);

const requestSpan = browserSpans!.find(({ description }) => description === 'request');
const requestSpan = browserSpans!.find(({ op }) => op === 'browser.request');
expect(requestSpan).toBeDefined();
expect(requestSpan?.description).toBe(page.url());

const measureSpan = eventData.spans?.find(({ op }) => op === 'measure');
expect(measureSpan).toBeDefined();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@sentry:registry=http://127.0.0.1:4873
@sentry-internal:registry=http://127.0.0.1:4873
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading

0 comments on commit ae901c3

Please sign in to comment.