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
19 changes: 19 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,25 @@ Sentry.init({
});
```

- The `_experiments.enableLogs` option was removed. Logs are now enabled by default, so if you were opting in via `_experiments.enableLogs: true` you can simply omit the option. Use the top-level `enableLogs: false` to opt out.

```js
// before
Sentry.init({
_experiments: {
enableLogs: true,
},
});

// after: logs are enabled by default, no option needed
Sentry.init({});

// or, to opt out
Sentry.init({
enableLogs: false,
});
```

- The deprecated `trackFetchStreamPerformance` option of `browserTracingIntegration` was removed. To track the duration of streamed fetch response bodies, add `fetchStreamPerformanceIntegration()` to your `integrations` array instead.

```js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,5 @@ Sentry.init({
traceLifecycle: 'static',
dsn: 'https://public@dsn.ingest.sentry.io/1337',
enableLogs: true,
// Purposefully specifying the experimental flag here
// to ensure the top level option is used instead.
_experiments: {
enableLogs: false,
},
integrations: [Sentry.consoleLoggingIntegration()],
});
5 changes: 1 addition & 4 deletions packages/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
});
}

// Backfill enableLogs option from _experiments.enableLogs
// todo(v11): Remove the experimental flag
// eslint-disable-next-line typescript/no-deprecated
this._options.enableLogs = this._options.enableLogs ?? this._options._experiments?.enableLogs ?? true;
this._options.enableLogs ??= true;

// Setup log flushing with weight and timeout tracking
if (this._options.enableLogs) {
Expand Down
8 changes: 0 additions & 8 deletions packages/core/src/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,6 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
* @deprecated Use the top level`beforeSendMetric` option instead.
*/
beforeSendMetric?: (metric: Metric) => Metric | null;

/**
* Determines if logs support should be enabled.
*
* @default false
* @deprecated Use the top level `enableLogs` option instead.
*/
enableLogs?: boolean;
};

/**
Expand Down
16 changes: 0 additions & 16 deletions packages/core/test/lib/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2954,22 +2954,6 @@ describe('Client', () => {
const client = new TestClient(options);
expect(client.getOptions().enableLogs).toBe(false);
});

it('can be disabled via the experimental option', () => {
const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, _experiments: { enableLogs: false } });
const client = new TestClient(options);
expect(client.getOptions().enableLogs).toBe(false);
});

test('top-level option takes precedence over experimental option', () => {
const options = getDefaultTestClientOptions({
dsn: PUBLIC_DSN,
enableLogs: false,
_experiments: { enableLogs: true },
});
const client = new TestClient(options);
expect(client.getOptions().enableLogs).toBe(false);
});
});

describe('log weight-based flushing', () => {
Expand Down
Loading