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
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ notSupported:
- javascript.bun
---

<PlatformContent includePath="configuration/console-logs-vs-breadcrumbs" />

<Alert>

This integration only works inside a browser environment.
Expand All @@ -34,13 +32,14 @@ This integration is enabled by default. If you'd like to modify your default int

The `breadcrumbsIntegration` wraps native APIs to capture breadcrumbs.

By default, the Sentry SDK wraps the `console`, `dom`, `fetch`, `history`, and `xhr` browser APIs to add breadcrumbs. You can opt out of capturing breadcrumbs for specific parts of your application (for example, you could say don't capture `console.log` calls as breadcrumbs) via the options below.
By default, the Sentry SDK wraps the `dom`, `fetch`, `history`, and `xhr` browser APIs to add breadcrumbs. You can opt out of capturing breadcrumbs for specific parts of your application (for example, you could say don't capture click and keypress events as breadcrumbs) via the options below.

Console calls are captured by the <PlatformLink to="/configuration/integrations/console/">`consoleIntegration`</PlatformLink>, which is enabled by default.

```JavaScript
Sentry.init({
integrations: [
Sentry.breadcrumbsIntegration({
console: true,
dom: true,
fetch: true,
history: true,
Expand All @@ -52,12 +51,6 @@ Sentry.init({

## Options

### `console`

_Type: `boolean`_

Log calls to `console.log`, `console.debug`, and so on.

### `dom`

_Type: `boolean` | `{ serializeAttribute: string | string[] }`_
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
---
title: Console
description: "Capture console logs as breadcrumbs. (default)"
customCanonicalTag: "/platforms/javascript/guides/express/configuration/integrations/console/"
customCanonicalTag: "/platforms/javascript/configuration/integrations/console/"
supported:
- javascript
- javascript.angular
- javascript.ember
- javascript.gatsby
- javascript.react
- javascript.solid
- javascript.svelte
- javascript.vue
- javascript.wasm
- javascript.node
- javascript.aws-lambda
- javascript.azure-functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,44 @@ Integrations automatically add error instrumentation, performance instrumentatio

To disable system integrations, set `defaultIntegrations: false` when calling `init()`.

To override their settings, provide a new instance with your config to the `integrations` option. For example, to turn off browser capturing console calls:
To override their settings, provide a new instance with your config to the `integrations` option.

<PlatformCategorySection supported={['browser']}>

For example, to stop capturing click and keypress events as breadcrumbs:

```javascript {3-7}
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [
Sentry.breadcrumbsIntegration({
console: false,
dom: false,
}),
],
});
```

</PlatformCategorySection>

<PlatformCategorySection supported={['server', 'serverless']}>
<PlatformSection notSupported={["javascript.deno", "javascript.cloudflare", "javascript.wasm"]}>

For example, to stop recording breadcrumbs for outgoing HTTP requests:

```javascript {3-7}
Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [
Sentry.httpIntegration({
breadcrumbs: false,
}),
],
});
```

</PlatformSection>
</PlatformCategorySection>

## Adding an Integration

You can add additional integrations in your `init` call:
Expand Down
14 changes: 0 additions & 14 deletions docs/platforms/javascript/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -380,20 +380,6 @@ Controls how many seconds to wait before shutting down. Sentry SDKs send events

</SdkOption>

<SdkOption name="disableInstrumentationWarnings" type='boolean' defaultValue='false' categorySupported={['server']}>

Depending on your setup, the Sentry SDK will try to detect if it has been incorrectly set up. This can result in warnings like this being logged:

> [Sentry] < libraryName > is not instrumented. This is likely because you required/imported < libraryName > before calling `Sentry.init()`.

Or

> [Sentry] < libraryName > is not instrumented. Please make sure to initialize Sentry in a separate file that you \`--import\` when running node, see: < docs link >.

This means the SDK detected that the library hasn't been wrapped for automatic performance instrumentation. This may result in some spans not being reported correctly. If this is not affecting you (for example because the warning is a false positive or you do not care about these specific spans), you can disable this warning by setting this option to `true`.

</SdkOption>

<PlatformSection supported={['javascript.electron']}>
<SdkOption name="ipcMode" type="'IPCMode.Classic' | 'IPCMode.Protocol' | 'IPCMode.Both'" defaultValue="'IPCMode.Both'">
**Note:** Electron `main` process only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ By default, the Sentry SDK sends information about the device and runtime to Sen

By default, the Sentry SDK sends JS console logs to Sentry as breadcrumbs which may contain PII data.

To disable sending console messages, set `console: false` in your `Sentry.breadcrumbsIntegration` config, see <PlatformLink to="/configuration/integrations/breadcrumbs/">the Breadcrumbs documentation</PlatformLink>.
To disable sending console messages, remove the `Console` integration from your `integrations` config, see <PlatformLink to="/configuration/integrations/console/">the Console documentation</PlatformLink>.

<PlatformSection notSupported={["javascript.electron"]}>
## Referrer URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ Web vitals also changed:
- `denoHttpIntegration` and `denoServeIntegration` honor `ignoreStatusCodes`, using the same default list as `httpIntegration`: incoming requests whose response status falls in `[[401, 404], [301, 303], [305, 399]]` are dropped. Each integration owns the option for the requests it instruments. Pass an empty array to keep everything. The filter only applies in transaction mode, which is why the option is deprecated and will be removed in v12.
- The incoming span hooks `onIncomingSpanCreated` and `onIncomingSpanEnd` were renamed to `onSpanCreated` and `onSpanEnd`. `denoHttpIntegration` also accepts `outgoingRequestHook`, `outgoingResponseHook`, and `outgoingRequestApplyCustomAttributes` now.
- The default integrations were renamed to match the other SDKs: `DenoAmqplib`, `DenoKoa`, `DenoMongodb`, `DenoMongoose`, `DenoMysql`, and `DenoPostgres` became `Amqplib`, `Koa`, `Mongodb`, `Mongoose`, `Mysql`, and `Postgres`. The old `deno*Integration` exports are kept as deprecated aliases.
- The `console` option of `breadcrumbsIntegration` was removed. Console breadcrumbs come from the default `consoleIntegration` now. To disable them, filter out the `Console` integration, and if you set `defaultIntegrations: false`, add `consoleIntegration()` to keep them.

</PlatformSection>

Expand Down Expand Up @@ -1352,7 +1353,7 @@ import type { BrowserClientReplayOptions } from "@sentry/core/browser";

### Browser

- The `console` option of `breadcrumbsIntegration` was removed. Use `consoleIntegration` to capture console breadcrumbs.
- The `console` option of `breadcrumbsIntegration` was removed. Console breadcrumbs come from the default `consoleIntegration` now. To disable them, filter out the `Console` integration, and if you set `defaultIntegrations: false`, add `consoleIntegration()` to keep them.
- AI integrations are no longer available in the browser SDK. They remain available in the server-side SDKs.

</PlatformCategorySection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ _Import name: `Sentry.breadcrumbsIntegration`_
This integration is enabled by default. You can also [modify default integrations](./../#modifying-default-integrations).

The `breadcrumbsIntegration` wraps native APIs to capture breadcrumbs.
By default, the Sentry SDK wraps all APIs. You can opt out of capturing breadcrumbs for specific parts of your application (for example, you could say don't capture `console.log` calls as breadcrumbs) via the options below.
By default, the Sentry SDK wraps all APIs. You can opt out of capturing breadcrumbs for specific parts of your application (for example, you could say don't capture outgoing fetch requests as breadcrumbs) via the options below.

## Options

### `console`

_Type: `boolean`_
Console calls are captured by the <PlatformLink to="/configuration/integrations/console/">`consoleIntegration`</PlatformLink>, which is enabled by default.

Log calls to `console.log`, `console.debug`, and so on.
## Options

### `fetch`

Expand All @@ -31,4 +27,3 @@ Log HTTP requests done with the Fetch API.
_Type: `boolean`_

Log whenever we send an event to the server.

13 changes: 12 additions & 1 deletion includes/migration/javascript-v11/console-breadcrumbs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,15 @@ platformCategory: browser
order: 205
---

The `console` option of `breadcrumbsIntegration` was removed. Use `consoleIntegration` to capture console breadcrumbs.
The `console` option of `breadcrumbsIntegration` was removed. Console breadcrumbs come from the default `consoleIntegration` now, which matches the server SDKs.

To disable console breadcrumbs, filter out the `Console` integration:

```js
Sentry.init({
integrations: (integrations) =>
integrations.filter((integration) => integration.name !== "Console"),
});
```

If you set `defaultIntegrations: false`, add `Sentry.consoleIntegration()` to keep capturing them.
23 changes: 23 additions & 0 deletions includes/migration/javascript-v11/deno-console-breadcrumbs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
id: deno-console-breadcrumbs
title: "Deno console breadcrumbs moved to `consoleIntegration`"
phase: code-changes
category: removed-api
severity: action-required
frameworks: [deno]
platformCategory: server
order: 311
---

The `console` option of `breadcrumbsIntegration` was removed. Console breadcrumbs come from the default `consoleIntegration` now, which matches the other server SDKs.

To disable console breadcrumbs, filter out the `Console` integration:

```js
Sentry.init({
integrations: integrations =>
integrations.filter(integration => integration.name !== "Console"),
});
```

If you set `defaultIntegrations: false`, add `Sentry.consoleIntegration()` to keep capturing them.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
| | **Auto Enabled** | **Errors** | **Tracing** | **Cron** | **Additional Context** |
| --------------------------------------------------- | :--------------: | :--------: | :---------: | :------: | :--------------------: |
| [`breadcrumbsIntegration`](./breadcrumbs) | ✓ | | | | ✓ |
| [`consoleIntegration`](./console) | ✓ | | | | ✓ |
| [`contextLinesIntegration`](./contextlines) | ✓ | ✓ | | | |
| [`dedupeIntegration`](./dedupe) | ✓ | ✓ | | | |
| [`denoContextIntegration`](./denocontext) | ✓ | | | | ✓ |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
| [`breadcrumbsIntegration`](./breadcrumbs) | ✓ | | | | ✓ |
| [`browserApiErrorsIntegration`](./browserapierrors) | ✓ | ✓ | | | |
| [`consoleIntegration`](./console) | ✓ | | | | ✓ |
| [`dedupeIntegration`](./dedupe) | ✓ | ✓ | | | |
| [`functionToStringIntegration`](./functiontostring) | ✓ | | | | |
| [`globalHandlersIntegration`](./globalhandlers) | ✓ | ✓ | | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| [`breadcrumbsIntegration`](./breadcrumbs) | ✓ | | | | ✓ |
| [`browserApiErrorsIntegration`](./browserapierrors) | ✓ | ✓ | | | |
| [`browserSessionIntegration`](./browsersession) | ✓ | | | | ✓ |
| [`consoleIntegration`](./console) | ✓ | | | | ✓ |
| [`dedupeIntegration`](./dedupe) | ✓ | ✓ | | | |
| [`functionToStringIntegration`](./functiontostring) | ✓ | | | | |
| [`globalHandlersIntegration`](./globalhandlers) | ✓ | ✓ | | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
| [`breadcrumbsIntegration`](./breadcrumbs) | ✓ | | | | ✓ |
| [`browserApiErrorsIntegration`](./browserapierrors) | ✓ | ✓ | | | |
| [`browserSessionIntegration`](./browsersession) | ✓ | | | | ✓ |
| [`consoleIntegration`](./console) | ✓ | | | | ✓ |
| [`dedupeIntegration`](./dedupe) | ✓ | ✓ | | | |
| [`functionToStringIntegration`](./functiontostring) | ✓ | | | | |
| [`globalHandlersIntegration`](./globalhandlers) | ✓ | ✓ | | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
|-------------------------------------------------------|:----------------:|:----------:|:-----------:|:----------:|:----------------------:|
| [`breadcrumbsIntegration`](./breadcrumbs) | ✓ | | | | ✓ |
| [`browserApiErrorsIntegration`](./browserapierrors) | ✓ | ✓ | | | |
| [`consoleIntegration`](./console) | ✓ | | | | ✓ |
| [`dedupeIntegration`](./dedupe) | ✓ | ✓ | | | |
| [`functionToStringIntegration`](./functiontostring) | ✓ | | | | |
| [`globalHandlersIntegration`](./globalhandlers) | ✓ | ✓ | | | |
Expand Down
Loading