Skip to content

Commit 2133f3c

Browse files
committed
Merge branch 'fix/tracing-improve-network-protocol' of github.com:getsentry/sentry-javascript into fix/tracing-improve-network-protocol
2 parents f833e5b + f630a60 commit 2133f3c

File tree

100 files changed

+1333
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1333
-583
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ jobs:
661661
needs: [job_get_metadata, job_build]
662662
if: needs.job_get_metadata.outputs.changed_node == 'true' || github.event_name != 'pull_request'
663663
runs-on: ubuntu-20.04
664-
timeout-minutes: 10
664+
timeout-minutes: 15
665665
strategy:
666666
fail-fast: false
667667
matrix:

.github/workflows/stale.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ build/
1010
dist/
1111
coverage/
1212
scratch/
13-
*.d.ts
1413
*.js.map
1514
*.pyc
1615
*.tsbuildinfo

CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,68 @@
44

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

7+
## 7.58.1
8+
9+
- fix(node): Set propagation context even when tracingOptions are not defined (#8517)
10+
11+
## 7.58.0
12+
13+
### Important Changes
14+
15+
- **Performance Monitoring not required for Distributed Tracing**
16+
17+
This release adds support for [distributed tracing](https://docs.sentry.io/platforms/javascript/usage/distributed-tracing/) without requiring performance monitoring to be active on the JavaScript SDKs (browser and node). This means even if there is no sampled transaction/span, the SDK will still propagate traces to downstream services. Distributed Tracing can be configured with the `tracePropagationTargets` option, which controls what requests to attach the `sentry-trace` and `baggage` HTTP headers to (which is what propagates tracing information).
18+
19+
```js
20+
Sentry.init({
21+
tracePropagationTargets: ["third-party-site.com", /^https:\/\/yourserver\.io\/api/],
22+
});
23+
```
24+
25+
- feat(tracing): Add tracing without performance to browser and client Sveltekit (#8458)
26+
- feat(node): Add tracing without performance to Node http integration (#8450)
27+
- feat(node): Add tracing without performance to Node Undici (#8449)
28+
- feat(node): Populate propagation context using env variables (#8422)
29+
30+
- **feat(core): Support `AggregateErrors` in `LinkedErrors` integration (#8463)**
31+
32+
This release adds support for [`AggregateErrors`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError). AggregateErrors are considered as Exception Groups by Sentry, and will be visualized and grouped differently. See the [Exception Groups Changelog Post](https://changelog.getsentry.com/announcements/exception-groups-now-supported-for-python-and-net) for more details.
33+
34+
Exception Group support requires Self-Hosted Sentry [version 23.5.1](https://github.com/getsentry/self-hosted/releases/tag/23.5.1) or newer.
35+
36+
- **feat(replay): Add a new option `networkDetailDenyUrls` (#8439)**
37+
38+
This release adds a new option `networkDetailDenyUrls` to the `Replay` integration. This option allows you to specify a list of URLs that should not be captured by the `Replay` integration, which can be used alongside the existing `networkDetailAllowUrls` for finely grained control of which URLs should have network details captured.
39+
40+
```js
41+
Sentry.init({
42+
integrations: [
43+
new Sentry.Integrations.Replay({
44+
networkDetailDenyUrls: [/^http:\/\/example.com\/test$/],
45+
}),
46+
],
47+
});
48+
```
49+
50+
### Other Changes
51+
52+
- feat(core): Add helpers to get module metadata from injected code (#8438)
53+
- feat(core): Add sampling decision to trace envelope header (#8483)
54+
- feat(node): Add trace context to checkin (#8503)
55+
- feat(node): Export `getModule` for Electron SDK (#8488)
56+
- feat(types): Allow `user.id` to be a number (#8330)
57+
- fix(browser): Set anonymous `crossorigin` attribute on report dialog (#8424)
58+
- fix(nextjs): Ignore `tunnelRoute` when doing static exports (#8471)
59+
- fix(nextjs): Use `basePath` option for `tunnelRoute` (#8454)
60+
- fix(node): Apply source context to linked errors even when it is uncached (#8453)
61+
- fix(node): report errorMiddleware errors as unhandled (#8048)
62+
- fix(react): Add support for `basename` option of `createBrowserRouter` (#8457)
63+
- fix(remix): Add explicit `@sentry/node` exports. (#8509)
64+
- fix(remix): Don't inject trace/baggage to `redirect` and `catch` responses (#8467)
65+
- fix(replay): Adjust slow/multi click handling (#8380)
66+
67+
Work in this release contributed by @mrdulin, @donaldxdonald & @ziyad-elabid-nw. Thank you for your contributions!
68+
769
## 7.57.0
870

971
### Important Changes

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3-
"version": "7.57.0",
3+
"version": "7.58.1",
44
"npmClient": "yarn"
55
}

packages/angular-ivy/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/angular-ivy",
3-
"version": "7.57.0",
3+
"version": "7.58.1",
44
"description": "Official Sentry SDK for Angular with full Ivy Support",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy",
@@ -21,9 +21,9 @@
2121
"rxjs": "^6.5.5 || ^7.x"
2222
},
2323
"dependencies": {
24-
"@sentry/browser": "7.57.0",
25-
"@sentry/types": "7.57.0",
26-
"@sentry/utils": "7.57.0",
24+
"@sentry/browser": "7.58.1",
25+
"@sentry/types": "7.58.1",
26+
"@sentry/utils": "7.58.1",
2727
"tslib": "^2.4.1"
2828
},
2929
"devDependencies": {

packages/angular/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/angular",
3-
"version": "7.57.0",
3+
"version": "7.58.1",
44
"description": "Official Sentry SDK for Angular",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular",
@@ -21,9 +21,9 @@
2121
"rxjs": "^6.5.5 || ^7.x"
2222
},
2323
"dependencies": {
24-
"@sentry/browser": "7.57.0",
25-
"@sentry/types": "7.57.0",
26-
"@sentry/utils": "7.57.0",
24+
"@sentry/browser": "7.58.1",
25+
"@sentry/types": "7.58.1",
26+
"@sentry/utils": "7.58.1",
2727
"tslib": "^2.4.1"
2828
},
2929
"devDependencies": {

packages/browser-integration-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "7.57.0",
3+
"version": "7.58.1",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {

packages/browser-integration-tests/suites/replay/dsc/test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ sentryTest(
4949
trace_id: expect.any(String),
5050
public_key: 'public',
5151
replay_id: replay.session?.id,
52+
sampled: 'true',
5253
});
5354
},
5455
);
@@ -93,6 +94,7 @@ sentryTest(
9394
sample_rate: '1',
9495
trace_id: expect.any(String),
9596
public_key: 'public',
97+
sampled: 'true',
9698
});
9799
},
98100
);
@@ -152,6 +154,7 @@ sentryTest(
152154
trace_id: expect.any(String),
153155
public_key: 'public',
154156
replay_id: replay.session?.id,
157+
sampled: 'true',
155158
});
156159
},
157160
);
@@ -199,6 +202,7 @@ sentryTest(
199202
sample_rate: '1',
200203
trace_id: expect.any(String),
201204
public_key: 'public',
205+
sampled: 'true',
202206
});
203207
},
204208
);

packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ sentryTest('captures multi click when not detecting slow click', async ({ getLoc
6464
]);
6565
});
6666

67-
sentryTest('captures multiple multi clicks', async ({ getLocalTestUrl, page, forceFlushReplay }) => {
68-
if (shouldSkipReplayTest()) {
67+
sentryTest('captures multiple multi clicks', async ({ getLocalTestUrl, page, forceFlushReplay, browserName }) => {
68+
// This test seems to only be flakey on firefox and webkit
69+
if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) {
6970
sentryTest.skip();
7071
}
7172

packages/browser-integration-tests/suites/tracing/envelope-header-transaction-name/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ sentryTest(
2727
transaction: expect.stringContaining('/index.html'),
2828
trace_id: expect.any(String),
2929
public_key: 'public',
30+
sampled: 'true',
3031
});
3132
},
3233
);

packages/browser-integration-tests/suites/tracing/envelope-header/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ sentryTest(
3030
sample_rate: '1',
3131
trace_id: expect.any(String),
3232
public_key: 'public',
33+
sampled: 'true',
3334
});
3435
},
3536
);

packages/browser/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/browser",
3-
"version": "7.57.0",
3+
"version": "7.58.1",
44
"description": "Official Sentry SDK for browsers",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
@@ -23,15 +23,15 @@
2323
"access": "public"
2424
},
2525
"dependencies": {
26-
"@sentry-internal/tracing": "7.57.0",
27-
"@sentry/core": "7.57.0",
28-
"@sentry/replay": "7.57.0",
29-
"@sentry/types": "7.57.0",
30-
"@sentry/utils": "7.57.0",
26+
"@sentry-internal/tracing": "7.58.1",
27+
"@sentry/core": "7.58.1",
28+
"@sentry/replay": "7.58.1",
29+
"@sentry/types": "7.58.1",
30+
"@sentry/utils": "7.58.1",
3131
"tslib": "^2.4.1 || ^1.9.3"
3232
},
3333
"devDependencies": {
34-
"@sentry-internal/integration-shims": "7.57.0",
34+
"@sentry-internal/integration-shims": "7.58.1",
3535
"@types/md5": "2.1.33",
3636
"btoa": "^1.2.1",
3737
"chai": "^4.1.2",

packages/browser/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export {
3434
spanStatusfromHttpCode,
3535
trace,
3636
makeMultiplexedTransport,
37+
ModuleMetadata,
3738
} from '@sentry/core';
3839
export type { SpanStatusType } from '@sentry/core';
3940
export type { Span } from '@sentry/types';

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry/core",
3-
"version": "7.57.0",
3+
"version": "7.58.1",
44
"description": "Base implementation for all Sentry JavaScript SDKs",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
@@ -23,8 +23,8 @@
2323
"access": "public"
2424
},
2525
"dependencies": {
26-
"@sentry/types": "7.57.0",
27-
"@sentry/utils": "7.57.0",
26+
"@sentry/types": "7.58.1",
27+
"@sentry/utils": "7.58.1",
2828
"tslib": "^2.4.1 || ^1.9.3"
2929
},
3030
"scripts": {

packages/core/src/checkin.ts

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,42 @@
1-
import type { CheckInEvelope, CheckInItem, DsnComponents, SdkMetadata, SerializedCheckIn } from '@sentry/types';
2-
import { createEnvelope, dsnToString } from '@sentry/utils';
1+
import type {
2+
CheckInEvelope,
3+
CheckInItem,
4+
DsnComponents,
5+
DynamicSamplingContext,
6+
SdkMetadata,
7+
SerializedCheckIn,
8+
} from '@sentry/types';
9+
import { createEnvelope, dropUndefinedKeys, dsnToString } from '@sentry/utils';
310

411
/**
512
* Create envelope from check in item.
613
*/
714
export function createCheckInEnvelope(
815
checkIn: SerializedCheckIn,
16+
dynamicSamplingContext?: Partial<DynamicSamplingContext>,
917
metadata?: SdkMetadata,
1018
tunnel?: string,
1119
dsn?: DsnComponents,
1220
): CheckInEvelope {
1321
const headers: CheckInEvelope[0] = {
1422
sent_at: new Date().toISOString(),
15-
...(metadata &&
16-
metadata.sdk && {
17-
sdk: {
18-
name: metadata.sdk.name,
19-
version: metadata.sdk.version,
20-
},
21-
}),
22-
...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),
2323
};
24+
25+
if (metadata && metadata.sdk) {
26+
headers.sdk = {
27+
name: metadata.sdk.name,
28+
version: metadata.sdk.version,
29+
};
30+
}
31+
32+
if (!!tunnel && !!dsn) {
33+
headers.dsn = dsnToString(dsn);
34+
}
35+
36+
if (dynamicSamplingContext) {
37+
headers.trace = dropUndefinedKeys(dynamicSamplingContext) as DynamicSamplingContext;
38+
}
39+
2440
const item = createCheckInEnvelopeItem(checkIn);
2541
return createEnvelope<CheckInEvelope>(headers, [item]);
2642
}

packages/core/src/exports.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,15 @@ export function startTransaction(
196196
* to create a monitor automatically when sending a check in.
197197
*/
198198
export function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {
199-
const client = getCurrentHub().getClient();
199+
const hub = getCurrentHub();
200+
const scope = hub.getScope();
201+
const client = hub.getClient();
200202
if (!client) {
201203
__DEBUG_BUILD__ && logger.warn('Cannot capture check-in. No client defined.');
202204
} else if (!client.captureCheckIn) {
203205
__DEBUG_BUILD__ && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');
204206
} else {
205-
return client.captureCheckIn(checkIn, upsertMonitorConfig);
207+
return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);
206208
}
207209

208210
return uuid4();

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export { prepareEvent } from './utils/prepareEvent';
4646
export { createCheckInEnvelope } from './checkin';
4747
export { hasTracingEnabled } from './utils/hasTracingEnabled';
4848
export { DEFAULT_ENVIRONMENT } from './constants';
49-
49+
export { ModuleMetadata } from './integrations/metadata';
5050
import * as Integrations from './integrations';
5151

5252
export { Integrations };

0 commit comments

Comments
 (0)