Skip to content

Commit

Permalink
Merge branch 'develop' into fix/tracing-improve-network-protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
k-fish committed Jul 14, 2023
2 parents f0cdc05 + 2b4121f commit f630a60
Show file tree
Hide file tree
Showing 100 changed files with 1,333 additions and 583 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ jobs:
needs: [job_get_metadata, job_build]
if: needs.job_get_metadata.outputs.changed_node == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-20.04
timeout-minutes: 10
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/stale.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ build/
dist/
coverage/
scratch/
*.d.ts
*.js.map
*.pyc
*.tsbuildinfo
Expand Down
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,68 @@

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

## 7.58.1

- fix(node): Set propagation context even when tracingOptions are not defined (#8517)

## 7.58.0

### Important Changes

- **Performance Monitoring not required for Distributed Tracing**

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).

```js
Sentry.init({
tracePropagationTargets: ["third-party-site.com", /^https:\/\/yourserver\.io\/api/],
});
```

- feat(tracing): Add tracing without performance to browser and client Sveltekit (#8458)
- feat(node): Add tracing without performance to Node http integration (#8450)
- feat(node): Add tracing without performance to Node Undici (#8449)
- feat(node): Populate propagation context using env variables (#8422)

- **feat(core): Support `AggregateErrors` in `LinkedErrors` integration (#8463)**

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.

Exception Group support requires Self-Hosted Sentry [version 23.5.1](https://github.com/getsentry/self-hosted/releases/tag/23.5.1) or newer.

- **feat(replay): Add a new option `networkDetailDenyUrls` (#8439)**

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.

```js
Sentry.init({
integrations: [
new Sentry.Integrations.Replay({
networkDetailDenyUrls: [/^http:\/\/example.com\/test$/],
}),
],
});
```

### Other Changes

- feat(core): Add helpers to get module metadata from injected code (#8438)
- feat(core): Add sampling decision to trace envelope header (#8483)
- feat(node): Add trace context to checkin (#8503)
- feat(node): Export `getModule` for Electron SDK (#8488)
- feat(types): Allow `user.id` to be a number (#8330)
- fix(browser): Set anonymous `crossorigin` attribute on report dialog (#8424)
- fix(nextjs): Ignore `tunnelRoute` when doing static exports (#8471)
- fix(nextjs): Use `basePath` option for `tunnelRoute` (#8454)
- fix(node): Apply source context to linked errors even when it is uncached (#8453)
- fix(node): report errorMiddleware errors as unhandled (#8048)
- fix(react): Add support for `basename` option of `createBrowserRouter` (#8457)
- fix(remix): Add explicit `@sentry/node` exports. (#8509)
- fix(remix): Don't inject trace/baggage to `redirect` and `catch` responses (#8467)
- fix(replay): Adjust slow/multi click handling (#8380)

Work in this release contributed by @mrdulin, @donaldxdonald & @ziyad-elabid-nw. Thank you for your contributions!

## 7.57.0

### Important Changes
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": "7.57.0",
"version": "7.58.1",
"npmClient": "yarn"
}
8 changes: 4 additions & 4 deletions packages/angular-ivy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular-ivy",
"version": "7.57.0",
"version": "7.58.1",
"description": "Official Sentry SDK for Angular with full Ivy Support",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy",
Expand All @@ -21,9 +21,9 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "7.57.0",
"@sentry/types": "7.57.0",
"@sentry/utils": "7.57.0",
"@sentry/browser": "7.58.1",
"@sentry/types": "7.58.1",
"@sentry/utils": "7.58.1",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/angular",
"version": "7.57.0",
"version": "7.58.1",
"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,9 +21,9 @@
"rxjs": "^6.5.5 || ^7.x"
},
"dependencies": {
"@sentry/browser": "7.57.0",
"@sentry/types": "7.57.0",
"@sentry/utils": "7.57.0",
"@sentry/browser": "7.58.1",
"@sentry/types": "7.58.1",
"@sentry/utils": "7.58.1",
"tslib": "^2.4.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion 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": "7.57.0",
"version": "7.58.1",
"main": "index.js",
"license": "MIT",
"engines": {
Expand Down
4 changes: 4 additions & 0 deletions packages/browser-integration-tests/suites/replay/dsc/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ sentryTest(
trace_id: expect.any(String),
public_key: 'public',
replay_id: replay.session?.id,
sampled: 'true',
});
},
);
Expand Down Expand Up @@ -93,6 +94,7 @@ sentryTest(
sample_rate: '1',
trace_id: expect.any(String),
public_key: 'public',
sampled: 'true',
});
},
);
Expand Down Expand Up @@ -152,6 +154,7 @@ sentryTest(
trace_id: expect.any(String),
public_key: 'public',
replay_id: replay.session?.id,
sampled: 'true',
});
},
);
Expand Down Expand Up @@ -199,6 +202,7 @@ sentryTest(
sample_rate: '1',
trace_id: expect.any(String),
public_key: 'public',
sampled: 'true',
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ sentryTest('captures multi click when not detecting slow click', async ({ getLoc
]);
});

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ sentryTest(
transaction: expect.stringContaining('/index.html'),
trace_id: expect.any(String),
public_key: 'public',
sampled: 'true',
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sentryTest(
sample_rate: '1',
trace_id: expect.any(String),
public_key: 'public',
sampled: 'true',
});
},
);
14 changes: 7 additions & 7 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/browser",
"version": "7.57.0",
"version": "7.58.1",
"description": "Official Sentry SDK for browsers",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
Expand All @@ -23,15 +23,15 @@
"access": "public"
},
"dependencies": {
"@sentry-internal/tracing": "7.57.0",
"@sentry/core": "7.57.0",
"@sentry/replay": "7.57.0",
"@sentry/types": "7.57.0",
"@sentry/utils": "7.57.0",
"@sentry-internal/tracing": "7.58.1",
"@sentry/core": "7.58.1",
"@sentry/replay": "7.58.1",
"@sentry/types": "7.58.1",
"@sentry/utils": "7.58.1",
"tslib": "^2.4.1 || ^1.9.3"
},
"devDependencies": {
"@sentry-internal/integration-shims": "7.57.0",
"@sentry-internal/integration-shims": "7.58.1",
"@types/md5": "2.1.33",
"btoa": "^1.2.1",
"chai": "^4.1.2",
Expand Down
1 change: 1 addition & 0 deletions packages/browser/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export {
spanStatusfromHttpCode,
trace,
makeMultiplexedTransport,
ModuleMetadata,
} from '@sentry/core';
export type { SpanStatusType } from '@sentry/core';
export type { Span } from '@sentry/types';
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sentry/core",
"version": "7.57.0",
"version": "7.58.1",
"description": "Base implementation for all Sentry JavaScript SDKs",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
Expand All @@ -23,8 +23,8 @@
"access": "public"
},
"dependencies": {
"@sentry/types": "7.57.0",
"@sentry/utils": "7.57.0",
"@sentry/types": "7.58.1",
"@sentry/utils": "7.58.1",
"tslib": "^2.4.1 || ^1.9.3"
},
"scripts": {
Expand Down
36 changes: 26 additions & 10 deletions packages/core/src/checkin.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
import type { CheckInEvelope, CheckInItem, DsnComponents, SdkMetadata, SerializedCheckIn } from '@sentry/types';
import { createEnvelope, dsnToString } from '@sentry/utils';
import type {
CheckInEvelope,
CheckInItem,
DsnComponents,
DynamicSamplingContext,
SdkMetadata,
SerializedCheckIn,
} from '@sentry/types';
import { createEnvelope, dropUndefinedKeys, dsnToString } from '@sentry/utils';

/**
* Create envelope from check in item.
*/
export function createCheckInEnvelope(
checkIn: SerializedCheckIn,
dynamicSamplingContext?: Partial<DynamicSamplingContext>,
metadata?: SdkMetadata,
tunnel?: string,
dsn?: DsnComponents,
): CheckInEvelope {
const headers: CheckInEvelope[0] = {
sent_at: new Date().toISOString(),
...(metadata &&
metadata.sdk && {
sdk: {
name: metadata.sdk.name,
version: metadata.sdk.version,
},
}),
...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),
};

if (metadata && metadata.sdk) {
headers.sdk = {
name: metadata.sdk.name,
version: metadata.sdk.version,
};
}

if (!!tunnel && !!dsn) {
headers.dsn = dsnToString(dsn);
}

if (dynamicSamplingContext) {
headers.trace = dropUndefinedKeys(dynamicSamplingContext) as DynamicSamplingContext;
}

const item = createCheckInEnvelopeItem(checkIn);
return createEnvelope<CheckInEvelope>(headers, [item]);
}
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,15 @@ export function startTransaction(
* to create a monitor automatically when sending a check in.
*/
export function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorConfig): string {
const client = getCurrentHub().getClient();
const hub = getCurrentHub();
const scope = hub.getScope();
const client = hub.getClient();
if (!client) {
__DEBUG_BUILD__ && logger.warn('Cannot capture check-in. No client defined.');
} else if (!client.captureCheckIn) {
__DEBUG_BUILD__ && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');
} else {
return client.captureCheckIn(checkIn, upsertMonitorConfig);
return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);
}

return uuid4();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export { prepareEvent } from './utils/prepareEvent';
export { createCheckInEnvelope } from './checkin';
export { hasTracingEnabled } from './utils/hasTracingEnabled';
export { DEFAULT_ENVIRONMENT } from './constants';

export { ModuleMetadata } from './integrations/metadata';
import * as Integrations from './integrations';

export { Integrations };
Loading

0 comments on commit f630a60

Please sign in to comment.