Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ module.exports = [
path: createCDNPath('bundle.tracing.min.js'),
gzip: false,
brotli: false,
limit: '124.1 KB',
limit: '125 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay) - uncompressed',
path: createCDNPath('bundle.tracing.replay.min.js'),
gzip: false,
brotli: false,
limit: '240 KB',
limit: '245 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed',
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@

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

## 10.24.0

### Important Changes

- **feat(metrics): Add top level option `enableMetrics` and `beforeSendMetric` ([#18088](https://github.com/getsentry/sentry-javascript/pull/18088))**

This PR moves `enableMetrics` and `beforeSendMetric` out of the `_experiments` options.
The metrics feature will now be **enabled by default** (none of our integrations will auto-emit metrics as of now), but you can disable sending metrics via `enableMetrics: false`.
Metric options within `_experiments` got deprecated but will still work as of now, they will be removed with the next major version of our SDKs.

### Other Changes

- feat(aws): Add `SENTRY_LAYER_EXTENSION` to configure using the lambda layer extension via env variables ([#18101](https://github.com/getsentry/sentry-javascript/pull/18101))
- feat(core): Include all exception object keys instead of truncating ([#18044](https://github.com/getsentry/sentry-javascript/pull/18044))
- feat(metrics)!: Update types ([#17907](https://github.com/getsentry/sentry-javascript/pull/17907))
- feat(replay): ignore `background-image` when `blockAllMedia` is enabled ([#18019](https://github.com/getsentry/sentry-javascript/pull/18019))
- fix(nextjs): Delete css map files ([#18131](https://github.com/getsentry/sentry-javascript/pull/18131))
- fix(nextjs): Stop accessing sync props in template ([#18113](https://github.com/getsentry/sentry-javascript/pull/18113))

<details>
<summary> <strong>Internal Changes</strong> </summary>

- chore: X handle update ([#18117](https://github.com/getsentry/sentry-javascript/pull/18117))
- chore(eslint): Add eslint-plugin-regexp rule (dev-packages) ([#18063](https://github.com/getsentry/sentry-javascript/pull/18063))
- test(next): fix flakey tests ([#18100](https://github.com/getsentry/sentry-javascript/pull/18100))
- test(node-core): Proof that withMonitor doesn't create a new trace ([#18057](https://github.com/getsentry/sentry-javascript/pull/18057))
</details>

## 10.23.0

- feat(core): Send `user-agent` header with envelope requests in server SDKs ([#17929](https://github.com/getsentry/sentry-javascript/pull/17929))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ convenient interface and improved consistency between various JavaScript environ
- [![Forum](https://img.shields.io/badge/forum-sentry-green.svg)](https://forum.sentry.io/c/sdks)
- [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr)
- [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](http://stackoverflow.com/questions/tagged/sentry)
- [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry)
- [![X Follow](https://img.shields.io/twitter/follow/sentry?label=sentry&style=social)](https://x.com/intent/follow?screen_name=sentry)

## Contents

Expand Down
4 changes: 3 additions & 1 deletion dev-packages/browser-integration-tests/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module.exports = {
browser: true,
node: true,
},
extends: ['../../.eslintrc.js'],
// todo: remove regexp plugin from here once we add it to base.js eslint config for the whole project
extends: ['../../.eslintrc.js', 'plugin:regexp/recommended'],
plugins: ['regexp'],
ignorePatterns: [
'suites/**/subject.js',
'suites/**/dist/*',
Expand Down
1 change: 1 addition & 0 deletions dev-packages/browser-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"devDependencies": {
"@types/glob": "8.0.0",
"@types/node": "^18.19.1",
"eslint-plugin-regexp": "^1.15.0",
"glob": "8.0.3"
},
"volta": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ sentryTest('allows to setup a client manually & capture exceptions', async ({ ge
},
},
contexts: {
trace: { trace_id: expect.stringMatching(/[a-f0-9]{32}/), span_id: expect.stringMatching(/[a-f0-9]{16}/) },
trace: { trace_id: expect.stringMatching(/[a-f\d]{32}/), span_id: expect.stringMatching(/[a-f\d]{16}/) },
},
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ sentryTest(

// Required profile metadata (Sample Format V2)
expect(typeof envelopeItemPayload1.profiler_id).toBe('string');
expect(envelopeItemPayload1.profiler_id).toMatch(/^[a-f0-9]{32}$/);
expect(envelopeItemPayload1.profiler_id).toMatch(/^[a-f\d]{32}$/);
expect(typeof envelopeItemPayload1.chunk_id).toBe('string');
expect(envelopeItemPayload1.chunk_id).toMatch(/^[a-f0-9]{32}$/);
expect(envelopeItemPayload1.chunk_id).toMatch(/^[a-f\d]{32}$/);
expect(envelopeItemPayload1.client_sdk).toBeDefined();
expect(typeof envelopeItemPayload1.client_sdk.name).toBe('string');
expect(typeof envelopeItemPayload1.client_sdk.version).toBe('string');
Expand Down Expand Up @@ -170,9 +170,9 @@ sentryTest(
// Required profile metadata (Sample Format V2)
// https://develop.sentry.dev/sdk/telemetry/profiles/sample-format-v2/
expect(typeof envelopeItemPayload2.profiler_id).toBe('string');
expect(envelopeItemPayload2.profiler_id).toMatch(/^[a-f0-9]{32}$/);
expect(envelopeItemPayload2.profiler_id).toMatch(/^[a-f\d]{32}$/);
expect(typeof envelopeItemPayload2.chunk_id).toBe('string');
expect(envelopeItemPayload2.chunk_id).toMatch(/^[a-f0-9]{32}$/);
expect(envelopeItemPayload2.chunk_id).toMatch(/^[a-f\d]{32}$/);
expect(envelopeItemPayload2.client_sdk).toBeDefined();
expect(typeof envelopeItemPayload2.client_sdk.name).toBe('string');
expect(typeof envelopeItemPayload2.client_sdk.version).toBe('string');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ sentryTest(
// Required profile metadata (Sample Format V2)
// https://develop.sentry.dev/sdk/telemetry/profiles/sample-format-v2/
expect(typeof envelopeItemPayload.profiler_id).toBe('string');
expect(envelopeItemPayload.profiler_id).toMatch(/^[a-f0-9]{32}$/);
expect(envelopeItemPayload.profiler_id).toMatch(/^[a-f\d]{32}$/);
expect(typeof envelopeItemPayload.chunk_id).toBe('string');
expect(envelopeItemPayload.chunk_id).toMatch(/^[a-f0-9]{32}$/);
expect(envelopeItemPayload.chunk_id).toMatch(/^[a-f\d]{32}$/);
expect(envelopeItemPayload.client_sdk).toBeDefined();
expect(typeof envelopeItemPayload.client_sdk.name).toBe('string');
expect(typeof envelopeItemPayload.client_sdk.version).toBe('string');
Expand Down Expand Up @@ -175,7 +175,7 @@ sentryTest('attaches thread data to child spans (trace mode)', async ({ page, ge
const profilerId = rootSpan?.contexts?.profile?.profiler_id as string | undefined;
expect(typeof profilerId).toBe('string');

expect(profilerId).toMatch(/^[a-f0-9]{32}$/);
expect(profilerId).toMatch(/^[a-f\d]{32}$/);

const spans = (rootSpan?.spans ?? []) as Array<{ data?: Record<string, unknown> }>;
expect(spans.length).toBeGreaterThan(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ window.Sentry = Sentry;

Sentry.init({
dsn: 'https://public@dsn.ingest.sentry.io/1337',
_experiments: {
enableMetrics: true,
},
release: '1.0.0',
environment: 'test',
integrations: integrations => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ sentryTest(
const traceId = transactionEnvelopeHeader.trace!.trace_id!;
const parentSpanId = transactionEnvelopeItem.contexts?.trace?.span_id;

expect(traceId).toMatch(/[a-f0-9]{32}/);
expect(parentSpanId).toMatch(/[a-f0-9]{16}/);
expect(traceId).toMatch(/[a-f\d]{32}/);
expect(parentSpanId).toMatch(/[a-f\d]{16}/);

expect(spanEnvelopeHeader).toEqual({
sent_at: expect.any(String),
Expand Down Expand Up @@ -76,7 +76,7 @@ sentryTest(
segment_id: transactionEnvelopeItem.contexts?.trace?.span_id,
parent_span_id: parentSpanId,
origin: 'manual',
span_id: expect.stringMatching(/[a-f0-9]{16}/),
span_id: expect.stringMatching(/[a-f\d]{16}/),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: traceId,
Expand Down Expand Up @@ -111,7 +111,7 @@ sentryTest(
description: 'inner',
origin: 'manual',
parent_span_id: parentSpanId,
span_id: expect.stringMatching(/[a-f0-9]{16}/),
span_id: expect.stringMatching(/[a-f\d]{16}/),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: traceId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ sentryTest('sends a segment span envelope', async ({ getLocalTestUrl, page }) =>
},
description: 'standalone_segment_span',
origin: 'manual',
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
span_id: expect.stringMatching(/^[\da-f]{16}$/),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/),
trace_id: expect.stringMatching(/^[\da-f]{32}$/),
is_segment: true,
segment_id: spanJson.span_id,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sentryTest(
expect(envHeader.trace).toEqual({
environment: 'production',
sample_rate: '1',
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
public_key: 'public',
replay_id: replay.session?.id,
sampled: 'true',
Expand Down Expand Up @@ -105,7 +105,7 @@ sentryTest(
expect(envHeader.trace).toEqual({
environment: 'production',
sample_rate: '1',
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
public_key: 'public',
sampled: 'true',
sample_rand: expect.any(String),
Expand Down Expand Up @@ -158,7 +158,7 @@ sentryTest(
expect(envHeader.trace).toEqual({
environment: 'production',
sample_rate: '1',
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
public_key: 'public',
replay_id: replay.session?.id,
sampled: 'true',
Expand Down Expand Up @@ -201,7 +201,7 @@ sentryTest(
expect(envHeader.trace).toEqual({
environment: 'production',
sample_rate: '1',
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
public_key: 'public',
sampled: 'true',
sample_rand: expect.any(String),
Expand Down Expand Up @@ -243,7 +243,7 @@ sentryTest('should add replay_id to error DSC while replay is active', async ({
expect(error1Header.trace).toBeDefined();
expect(error1Header.trace).toEqual({
environment: 'production',
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
public_key: 'public',
replay_id: replay.session?.id,
...(hasTracing
Expand All @@ -265,7 +265,7 @@ sentryTest('should add replay_id to error DSC while replay is active', async ({
expect(error2Header.trace).toBeDefined();
expect(error2Header.trace).toEqual({
environment: 'production',
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
public_key: 'public',
...(hasTracing
? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sentryTest('creates fetch spans with http timing', async ({ browserName, getLoca
expect(span).toMatchObject({
description: `GET http://sentry-test-site.example/${index}`,
parent_span_id: tracingEvent.contexts?.trace?.span_id,
span_id: expect.stringMatching(/[a-f0-9]{16}/),
span_id: expect.stringMatching(/[a-f\d]{16}/),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: tracingEvent.contexts?.trace?.trace_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ sentryTest.describe('When `consistentTraceSampling` is `true` and page contains

expect(extractTraceparentData(sentryTrace)).toEqual({
traceId: expect.not.stringContaining(metaTagTraceId),
parentSpanId: expect.stringMatching(/^[0-9a-f]{16}$/),
parentSpanId: expect.stringMatching(/^[\da-f]{16}$/),
parentSampled: false,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sentryTest.describe('When `consistentTraceSampling` is `true` and page contains

expect(extractTraceparentData(sentryTrace)).toEqual({
traceId: expect.not.stringContaining(metaTagTraceIdIndex),
parentSpanId: expect.stringMatching(/^[0-9a-f]{16}$/),
parentSpanId: expect.stringMatching(/^[\da-f]{16}$/),
parentSampled: false,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ sentryTest.describe('When `consistentTraceSampling` is `true`', () => {
{
attributes: { 'sentry.link.type': 'previous_trace' },
sampled: false,
span_id: expect.stringMatching(/^[0-9a-f]{16}$/),
trace_id: expect.stringMatching(/^[0-9a-f]{32}$/),
span_id: expect.stringMatching(/^[\da-f]{16}$/),
trace_id: expect.stringMatching(/^[\da-f]{32}$/),
},
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ sentryTest('includes a span link to a previously negatively sampled span', async
expect(navigationTraceContext?.op).toBe('navigation');
expect(navigationTraceContext?.links).toEqual([
{
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
span_id: expect.stringMatching(/[a-f0-9]{16}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
span_id: expect.stringMatching(/[a-f\d]{16}/),
sampled: false,
attributes: {
[SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE]: 'previous_trace',
Expand All @@ -34,7 +34,7 @@ sentryTest('includes a span link to a previously negatively sampled span', async
]);

expect(navigationTraceContext?.data).toMatchObject({
'sentry.previous_trace': expect.stringMatching(/[a-f0-9]{32}-[a-f0-9]{16}-0/),
'sentry.previous_trace': expect.stringMatching(/[a-f\d]{32}-[a-f\d]{16}-0/),
});

expect(navigationTraceContext?.trace_id).not.toEqual(navigationTraceContext?.links![0].trace_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ sentryTest('errors in TwP mode have same trace ID & span IDs', async ({ getLocal

// Span ID is a virtual span, not the propagated one
expect(spanId1).not.toEqual(spanId);
expect(spanId1).toMatch(/^[a-f0-9]{16}$/);
expect(spanId1).toMatch(/^[a-f\d]{16}$/);

const contexts2 = event2.contexts;
const { trace_id: traceId2, span_id: spanId2 } = contexts2?.trace || {};
expect(traceId2).toEqual(traceId);
expect(spanId2).toMatch(/^[a-f0-9]{16}$/);
expect(spanId2).toMatch(/^[a-f\d]{16}$/);

expect(spanId2).toEqual(spanId1);
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ sentryTest('errors in TwP mode have same trace ID & span IDs', async ({ getLocal

const contexts1 = event1.contexts;
const { trace_id: traceId1, span_id: spanId1 } = contexts1?.trace || {};
expect(traceId1).toMatch(/^[a-f0-9]{32}$/);
expect(spanId1).toMatch(/^[a-f0-9]{16}$/);
expect(traceId1).toMatch(/^[a-f\d]{32}$/);
expect(spanId1).toMatch(/^[a-f\d]{16}$/);

const contexts2 = event2.contexts;
const { trace_id: traceId2, span_id: spanId2 } = contexts2?.trace || {};
expect(traceId2).toMatch(/^[a-f0-9]{32}$/);
expect(spanId2).toMatch(/^[a-f0-9]{16}$/);
expect(traceId2).toMatch(/^[a-f\d]{32}$/);
expect(spanId2).toMatch(/^[a-f\d]{16}$/);

expect(traceId2).toEqual(traceId1);
expect(spanId2).toEqual(spanId1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ sentryTest('updates the DSC when the txn name is updated and high-quality', asyn
return (window as any).__traceId;
});

expect(traceId).toMatch(/^[0-9a-f]{32}$/);
expect(traceId).toMatch(/^[\da-f]{32}$/);

// 2
const baggageItems = await makeRequestAndGetBaggageItems(page);
expect(baggageItems).toEqual([
'sentry-environment=production',
'sentry-public_key=public',
'sentry-release=1.1.1',
expect.stringMatching(/sentry-sample_rand=0\.[0-9]+/),
expect.stringMatching(/sentry-sample_rand=0\.\d+/),
'sentry-sample_rate=1',
'sentry-sampled=true',
`sentry-trace_id=${traceId}`,
Expand All @@ -83,7 +83,7 @@ sentryTest('updates the DSC when the txn name is updated and high-quality', asyn
'sentry-environment=production',
'sentry-public_key=public',
'sentry-release=1.1.1',
expect.stringMatching(/sentry-sample_rand=0\.[0-9]+/),
expect.stringMatching(/sentry-sample_rand=0\.\d+/),
'sentry-sample_rate=1',
'sentry-sampled=true',
`sentry-trace_id=${traceId}`,
Expand Down Expand Up @@ -112,7 +112,7 @@ sentryTest('updates the DSC when the txn name is updated and high-quality', asyn
'sentry-environment=production',
'sentry-public_key=public',
'sentry-release=1.1.1',
expect.stringMatching(/sentry-sample_rand=0\.[0-9]+/),
expect.stringMatching(/sentry-sample_rand=0\.\d+/),
'sentry-sample_rate=1',
'sentry-sampled=true',
`sentry-trace_id=${traceId}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sentryTest(
environment: 'production',
sample_rate: '1',
transaction: expect.stringContaining('/index.html'),
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
public_key: 'public',
sampled: 'true',
sample_rand: expect.any(String),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sentryTest(
expect(envHeader.trace).toEqual({
environment: 'production',
sample_rate: '1',
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
trace_id: expect.stringMatching(/[a-f\d]{32}/),
public_key: 'public',
sampled: 'true',
sample_rand: expect.any(String),
Expand Down
Loading
Loading