Skip to content

meta(changelog): Update changelog for 8.0.0-beta.2 #11654

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 22 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
abd79ea
test(browser-integration-tests): Test that errors during pageload/nav…
Lms24 Apr 15, 2024
1a715fc
Merge pull request #11616 from getsentry/master
github-actions[bot] Apr 15, 2024
8cb70e3
test(browser-integration-tests): Test trace lifetime for outgoing `fe…
Lms24 Apr 16, 2024
39c8290
test(browser-integration-tests): Add trace lifetime tests for `<meta>…
Lms24 Apr 16, 2024
ee4091e
fix(browser): Don't assume window.document is available (#11602)
Apr 16, 2024
452bcae
fix(node): Allow use of `NodeClient` without calling `init` (#11585)
timfish Apr 16, 2024
1a22856
feat(node): Collect Local Variables via a worker (#11586)
timfish Apr 16, 2024
44bc6cf
fix(nextjs): Escape Next.js' OpenTelemetry instrumentation (#11625)
Apr 16, 2024
d5ac938
ref(core): Rename `Hub` to `AsyncContextStack` & remove unneeded meth…
mydea Apr 16, 2024
379a9e5
fix(node): Ensure DSC is correctly set in envelope headers (#11628)
mydea Apr 16, 2024
f1c4611
test(browser-integration-test): Add trace lifetime tests for XHR requ…
Lms24 Apr 16, 2024
0d2c960
feat(nextjs): Skip OTEL root spans emitted by Next.js (#11623)
mydea Apr 16, 2024
919f60b
doc: Add clarifying comment for hub on ACS (#11633)
mydea Apr 16, 2024
8b6f838
feat(opentelemetry): Update OTEL packages & relax some version ranges…
mydea Apr 16, 2024
38758b9
fix(feedback): Fix timeout on feedback submission (#11619)
c298lee Apr 16, 2024
08e26ab
feat(deps): bump @opentelemetry/instrumentation-koa from 0.37.0 to 0.…
dependabot[bot] Apr 16, 2024
6f5dd50
feat(deps): bump @opentelemetry/instrumentation-pg from 0.38.0 to 0.4…
dependabot[bot] Apr 16, 2024
2c840c3
feat(deps): bump @opentelemetry/instrumentation-hapi from 0.34.0 to 0…
dependabot[bot] Apr 16, 2024
daf2edf
feat(core): Add `server.address` to browser `http.client` spans (#11634)
mydea Apr 17, 2024
cfcd226
feat(browser): Update `propagationContext` on `spanEnd` to keep trace…
Lms24 Apr 17, 2024
64dffbf
update changelog
s1gr1d Apr 17, 2024
3be73a6
delete non-user-facing change
s1gr1d Apr 17, 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
2 changes: 1 addition & 1 deletion .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module.exports = [
'tls',
],
gzip: true,
limit: '150 KB',
limit: '160 KB',
},
];

Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@

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

## 8.0.0-beta.2

### Important Changes

- **feat(browser): Update `propagationContext` on `spanEnd` to keep trace consistent**

To ensure consistency throughout a route's duration, we update the scope's propagation context when the initial page
load or navigation span ends. This keeps span-specific attributes like the sampled decision and dynamic sampling context
on the scope, even after the transaction has ended.

- **fix(browser): Don't assume window.document is available (#11602)**

We won't assume `window.dodument` is available in the browser SDKs anymore. This should prevent errors in environments
where `window.document` is not available (such as web workers).

### Other changes

- feat(core): Add `server.address` to browser `http.client` spans (#11634)
- feat(opentelemetry): Update OTEL packages & relax some version ranges (#11580)
- feat(deps): bump @opentelemetry/instrumentation-hapi from 0.34.0 to 0.36.0 (#11496)
- feat(deps): bump @opentelemetry/instrumentation-koa from 0.37.0 to 0.39.0 (#11495)
- feat(deps): bump @opentelemetry/instrumentation-pg from 0.38.0 to 0.40.0 (#11494)
- feat(nextjs): Skip OTEL root spans emitted by Next.js (#11623)
- feat(node): Collect Local Variables via a worker (#11586)
- fix(nextjs): Escape Next.js' OpenTelemetry instrumentation (#11625)
- fix(feedback): Fix timeout on feedback submission (#11619)
- fix(node): Allow use of `NodeClient` without calling `init` (#11585)
- fix(node): Ensure DSC is correctly set in envelope headers (#11628)

## 8.0.0-beta.1

This is the first beta release of Sentry JavaScript SDK v8. With this release, there are no more planned breaking
Expand Down
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://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fetch('/test-req/0').then(
fetch('/test-req/1', { headers: { 'X-Test-Header': 'existing-header' } }).then(fetch('/test-req/2')),
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { expect } from '@playwright/test';

import { TEST_HOST, sentryTest } from '../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipTracingTest,
waitForTransactionRequestOnUrl,
} from '../../../../utils/helpers';

sentryTest('should create spans for fetch requests', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForTransactionRequestOnUrl(page, url);
const tracingEvent = envelopeRequestParser(req);

const requestSpans = tracingEvent.spans?.filter(({ op }) => op === 'http.client');

expect(requestSpans).toHaveLength(3);

requestSpans?.forEach((span, index) =>
expect(span).toMatchObject({
description: `GET /test-req/${index}`,
parent_span_id: tracingEvent.contexts?.trace?.span_id,
span_id: expect.any(String),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': `${TEST_HOST}/test-req/${index}`,
url: `/test-req/${index}`,
'server.address': 'sentry-test.io',
type: 'fetch',
},
}),
);
});

sentryTest('should attach `sentry-trace` header to fetch requests', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

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

const requests = (
await Promise.all([
page.goto(url),
Promise.all([0, 1, 2].map(idx => page.waitForRequest(`${TEST_HOST}/test-req/${idx}`))),
])
)[1];

expect(requests).toHaveLength(3);

const request1 = requests[0];
const requestHeaders1 = request1.headers();
expect(requestHeaders1).toMatchObject({
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
baggage: expect.any(String),
});

const request2 = requests[1];
const requestHeaders2 = request2.headers();
expect(requestHeaders2).toMatchObject({
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
baggage: expect.any(String),
'x-test-header': 'existing-header',
});

const request3 = requests[2];
const requestHeaders3 = request3.headers();
expect(requestHeaders3).toMatchObject({
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
baggage: expect.any(String),
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ sentryTest('should create spans for fetch requests', async ({ getLocalTestPath,
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': `http://example.com/${index}`,
url: `http://example.com/${index}`,
'server.address': 'example.com',
type: 'fetch',
},
}),
);
});
Expand Down
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://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.browserTracingIntegration()],
tracesSampleRate: 1,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const xhr_1 = new XMLHttpRequest();
xhr_1.open('GET', '/test-req/0');
xhr_1.send();

const xhr_2 = new XMLHttpRequest();
xhr_2.open('GET', '/test-req/1');
xhr_2.setRequestHeader('X-Test-Header', 'existing-header');
xhr_2.send();

const xhr_3 = new XMLHttpRequest();
xhr_3.open('GET', '/test-req/2');
xhr_3.send();
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { expect } from '@playwright/test';

import { TEST_HOST, sentryTest } from '../../../../utils/fixtures';
import {
envelopeRequestParser,
shouldSkipTracingTest,
waitForTransactionRequestOnUrl,
} from '../../../../utils/helpers';

sentryTest('should create spans for xhr requests', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

const url = await getLocalTestUrl({ testDir: __dirname });
const req = await waitForTransactionRequestOnUrl(page, url);
const tracingEvent = envelopeRequestParser(req);

const requestSpans = tracingEvent.spans?.filter(({ op }) => op === 'http.client');

expect(requestSpans).toHaveLength(3);

requestSpans?.forEach((span, index) =>
expect(span).toMatchObject({
description: `GET /test-req/${index}`,
parent_span_id: tracingEvent.contexts?.trace?.span_id,
span_id: expect.any(String),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: tracingEvent.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': `${TEST_HOST}/test-req/${index}`,
url: `/test-req/${index}`,
'server.address': 'sentry-test.io',
type: 'xhr',
},
}),
);
});

sentryTest('should attach `sentry-trace` header to xhr requests', async ({ getLocalTestUrl, page }) => {
if (shouldSkipTracingTest()) {
sentryTest.skip();
}

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

const requests = (
await Promise.all([
page.goto(url),
Promise.all([0, 1, 2].map(idx => page.waitForRequest(`${TEST_HOST}/test-req/${idx}`))),
])
)[1];

expect(requests).toHaveLength(3);

const request1 = requests[0];
const requestHeaders1 = request1.headers();
expect(requestHeaders1).toMatchObject({
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
baggage: expect.any(String),
});

const request2 = requests[1];
const requestHeaders2 = request2.headers();
expect(requestHeaders2).toMatchObject({
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
baggage: expect.any(String),
'x-test-header': 'existing-header',
});

const request3 = requests[2];
const requestHeaders3 = request3.headers();
expect(requestHeaders3).toMatchObject({
'sentry-trace': expect.stringMatching(/^([a-f0-9]{32})-([a-f0-9]{16})-1$/),
baggage: expect.any(String),
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ sentryTest('should create spans for XHR requests', async ({ getLocalTestPath, pa
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: eventData.contexts?.trace?.trace_id,
data: {
'http.method': 'GET',
'http.url': `http://example.com/${index}`,
url: `http://example.com/${index}`,
'server.address': 'example.com',
type: 'xhr',
},
}),
);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Tests in this suite are meant to test the lifetime of a trace in the browser SDK and how different events sent are
connected to a trace. This suite distinguishes the following cases:

1. `pageload` - Traces started on the initial pageload as head of trace
2. `pageload-meta` - Traces started on the initial pageload as a continuation of the trace on the server (via `<meta>`
tags)
3. `navigation` - Traces started during navigations on a page

Tests scenarios should be fairly similar for all three cases but it's important we test all of them.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ window.Sentry = Sentry;
Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
integrations: [Sentry.browserTracingIntegration()],
tracePropagationTargets: ['http://example.com'],
tracesSampleRate: 1,
});
Loading