Skip to content

Commit 1ad5d48

Browse files
AbhiPrasadlizokmLms24
authored
feat(js): Import BrowserTracing directly from a browser SDK (#6508)
Co-authored-by: Liza Mock <[email protected]> Co-authored-by: Lukas Stracke <[email protected]>
1 parent 15bd975 commit 1ad5d48

File tree

40 files changed

+162
-226
lines changed

40 files changed

+162
-226
lines changed

src/platform-includes/getting-started-config/javascript.angular.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Once this is done, Sentry's Angular SDK captures all unhandled exceptions and tr
44
import { enableProdMode } from "@angular/core";
55
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
66
import * as Sentry from "@sentry/angular-ivy";
7-
import { BrowserTracing } from "@sentry/tracing";
87
import { AppModule } from "./app/app.module";
98
109
Sentry.init({
@@ -13,7 +12,7 @@ Sentry.init({
1312
// Registers and configures the Tracing integration,
1413
// which automatically instruments your application to monitor its
1514
// performance, including custom Angular routing instrumentation
16-
new BrowserTracing({
15+
new Sentry.BrowserTracing({
1716
tracePropagationTargets: ["localhost", "https://yourserver.io/api"],
1817
routingInstrumentation: Sentry.routingInstrumentation,
1918
}),
@@ -35,7 +34,6 @@ platformBrowserDynamic()
3534
import { enableProdMode } from "@angular/core";
3635
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
3736
import * as Sentry from "@sentry/angular";
38-
import { BrowserTracing } from "@sentry/tracing";
3937
import { AppModule } from "./app/app.module";
4038
4139
Sentry.init({
@@ -44,7 +42,7 @@ Sentry.init({
4442
// Registers and configures the Tracing integration,
4543
// which automatically instruments your application to monitor its
4644
// performance, including custom Angular routing instrumentation
47-
new BrowserTracing({
45+
new Sentry.BrowserTracing({
4846
tracePropagationTargets: ["localhost", "https://yourserver.io/api"],
4947
routingInstrumentation: Sentry.routingInstrumentation,
5048
}),

src/platform-includes/getting-started-config/javascript.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ Once this is done, Sentry's JavaScript SDK captures all unhandled exceptions and
22

33
```javascript {tabTitle: ESM}
44
import * as Sentry from "@sentry/browser";
5-
import { BrowserTracing } from "@sentry/tracing";
65

76
Sentry.init({
87
dsn: "___PUBLIC_DSN___",
98

109
// Alternatively, use `process.env.npm_package_version` for a dynamic release version
1110
// if your build tool supports it.
1211
release: "[email protected]",
13-
integrations: [new BrowserTracing()],
12+
integrations: [new Sentry.BrowserTracing()],
1413

1514
// Set tracesSampleRate to 1.0 to capture 100%
1615
// of transactions for performance monitoring.

src/platform-includes/getting-started-config/javascript.react.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
import React from "react";
33
import ReactDOM from "react-dom";
44
import * as Sentry from "@sentry/react";
5-
import { BrowserTracing } from "@sentry/tracing";
65
import App from "./App";
76

87
Sentry.init({
98
dsn: "___PUBLIC_DSN___",
10-
integrations: [new BrowserTracing()],
9+
integrations: [new Sentry.BrowserTracing()],
1110

1211
// We recommend adjusting this value in production, or using tracesSampler
1312
// for finer control

src/platform-includes/getting-started-config/javascript.svelte.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import "./app.css";
55
import App from "./App.svelte";
66

77
import * as Sentry from "@sentry/svelte";
8-
import { BrowserTracing } from "@sentry/tracing";
98

109
// Initialize the Sentry SDK here
1110
Sentry.init({
1211
dsn: "___PUBLIC_DSN___",
13-
integrations: [new BrowserTracing()],
12+
integrations: [new Sentry.BrowserTracing()],
1413

1514
// Set tracesSampleRate to 1.0 to capture 100%
1615
// of transactions for performance monitoring.
@@ -30,12 +29,11 @@ import "./app.css";
3029
import App from "./App.svelte";
3130

3231
import * as Sentry from "@sentry/svelte";
33-
import { BrowserTracing } from "@sentry/tracing";
3432

3533
// Initialize the Sentry SDK here
3634
Sentry.init({
3735
dsn: "___PUBLIC_DSN___",
38-
integrations: [new BrowserTracing()],
36+
integrations: [new Sentry.BrowserTracing()],
3937

4038
// Set tracesSampleRate to 1.0 to capture 100%
4139
// of transactions for performance monitoring.

src/platform-includes/getting-started-config/javascript.vue.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ To initialize Sentry in your Vue application, add this to your `app.js`:
66
import Vue from "vue";
77
import Router from "vue-router";
88
import * as Sentry from "@sentry/vue";
9-
import { BrowserTracing } from "@sentry/tracing";
109

1110
Vue.use(Router);
1211

@@ -18,7 +17,7 @@ Sentry.init({
1817
Vue,
1918
dsn: "___PUBLIC_DSN___",
2019
integrations: [
21-
new BrowserTracing({
20+
new Sentry.BrowserTracing({
2221
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
2322
tracePropagationTargets: ["localhost", "my-site-url.com", /^\//],
2423
}),
@@ -43,7 +42,6 @@ new Vue({
4342
import { createApp } from "vue";
4443
import { createRouter } from "vue-router";
4544
import * as Sentry from "@sentry/vue";
46-
import { BrowserTracing } from "@sentry/tracing";
4745

4846
const app = createApp({
4947
// ...
@@ -56,7 +54,7 @@ Sentry.init({
5654
app,
5755
dsn: "___PUBLIC_DSN___",
5856
integrations: [
59-
new BrowserTracing({
57+
new Sentry.BrowserTracing({
6058
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
6159
tracePropagationTargets: ["localhost", "my-site-url.com", /^\//],
6260
}),

src/platform-includes/getting-started-install/javascript.angular.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
```bash {tabTitle:npm}
22
# Angular 12 and newer:
3-
npm install --save @sentry/angular-ivy @sentry/tracing
3+
npm install --save @sentry/angular-ivy
44

55
# Angular 10 and 11:
6-
npm install --save @sentry/angular @sentry/tracing
6+
npm install --save @sentry/angular
77
```
88

99
```bash {tabTitle:Yarn}
1010
# Angular 12 and newer:
11-
yarn add @sentry/angular-ivy @sentry/tracing
11+
yarn add @sentry/angular-ivy
1212

1313
# Angular 10 and 11:
14-
yarn add @sentry/angular @sentry/tracing
14+
yarn add @sentry/angular
1515
```
1616

1717
### Angular Version Compatibility

src/platform-includes/getting-started-install/javascript.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
```bash {tabTitle: yarn}
2-
yarn add @sentry/browser @sentry/tracing
2+
yarn add @sentry/browser
33
```
44

55
```bash {tabTitle: npm}
6-
npm install --save @sentry/browser @sentry/tracing
6+
npm install --save @sentry/browser
77
```
88

99
<Note>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```bash {tabTitle: ESM}
22
# Using npm
3-
npm install --save @sentry/react @sentry/tracing
3+
npm install --save @sentry/react
44

55
# Using yarn
6-
yarn add @sentry/react @sentry/tracing
6+
yarn add @sentry/react
77
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```bash {tabTitle:npm}
2-
npm install --save @sentry/svelte @sentry/tracing
2+
npm install --save @sentry/svelte
33
```
44

55
```bash {tabTitle:yarn}
6-
yarn add @sentry/svelte @sentry/tracing
6+
yarn add @sentry/svelte
77
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```bash {tabTitle:npm}
2-
npm install --save @sentry/vue @sentry/tracing
2+
npm install --save @sentry/vue
33
```
44

55
```bash {tabTitle:Yarn}
6-
yarn add @sentry/vue @sentry/tracing
6+
yarn add @sentry/vue
77
```

0 commit comments

Comments
 (0)