-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(js): Add js tracing without performance docs (#7421)
Co-authored-by: Liza Mock <[email protected]>
- Loading branch information
1 parent
f1f4b6b
commit 2d224d9
Showing
7 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/platform-includes/distributed-tracing/how-to-use/javascript.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
If you're using the current version of our JavaScript SDK and have enabled the `BrowserTracing` integration, distributed tracing will work out of the box. To get around possible [Browser CORs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, define your `tracePropagationTargets`. | ||
|
||
```js | ||
Sentry.init({ | ||
dsn: "__DSN__", | ||
integrations: [new Sentry.BrowserTracing()], | ||
tracePropagationTargets: [ | ||
"https://myproject.org", | ||
"https://.*.otherservice.org/.*", | ||
], | ||
}); | ||
``` | ||
|
||
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> in order for distributed tracing to work. |
17 changes: 17 additions & 0 deletions
17
src/platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
If you're using the current version of our Next.js SDK, distributed tracing will work out of the box for the client, server, and edge runtimes. | ||
|
||
For client-side you might have to define `tracePropagationTargets` to get around possible [Browser CORs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues. | ||
|
||
```js | ||
// sentry.client.config.js | ||
Sentry.init({ | ||
dsn: "__DSN__", | ||
integrations: [new Sentry.BrowserTracing()], | ||
tracePropagationTargets: [ | ||
"https://myproject.org", | ||
"https://.*.otherservice.org/.*", | ||
], | ||
}); | ||
``` | ||
|
||
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> in order for distributed tracing to work. |
15 changes: 15 additions & 0 deletions
15
src/platform-includes/distributed-tracing/how-to-use/javascript.remix.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
If you're using the current version of our Remix SDK, distributed tracing will work out of the box for the client and server. To get around possible [Browser CORs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, you should define `tracePropagationTargets` for client-side. | ||
|
||
```tsx | ||
// entry.client.tsx | ||
Sentry.init({ | ||
dsn: "__DSN__", | ||
integrations: [new Sentry.BrowserTracing()], | ||
tracePropagationTargets: [ | ||
"https://myproject.org", | ||
"https://.*.otherservice.org/.*", | ||
], | ||
}); | ||
``` | ||
|
||
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> in order for distributed tracing to work. |
15 changes: 15 additions & 0 deletions
15
src/platform-includes/distributed-tracing/how-to-use/javascript.sveltekit.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
If you're using the current version of our SvelteKit SDK, distributed tracing will work out of the box for the client and server runtimes. To get around possible [Browser CORs](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, you should define `tracePropagationTargets` for client-side. | ||
|
||
```js | ||
// hooks.client.js | ||
Sentry.init({ | ||
dsn: "__DSN__", | ||
integrations: [new BrowserTracing()], | ||
tracePropagationTargets: [ | ||
"https://myproject.org", | ||
"https://.*.otherservice.org/.*", | ||
], | ||
}); | ||
``` | ||
|
||
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work. |
22 changes: 22 additions & 0 deletions
22
src/platform-includes/distributed-tracing/how-to-use/node.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
If you're using version `7.58.0` or above of our Node SDK and have the HTTP integration set up, distributed tracing will work out of the box. | ||
|
||
```js | ||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [new Sentry.Integrations.Http({ tracing: true })], | ||
}); | ||
``` | ||
|
||
If you're using express or an express-compatible framework, you'll also need to use Sentry middleware: | ||
|
||
```js | ||
const app = express(); | ||
|
||
// RequestHandler creates a separate execution context, so that all | ||
// transactions/spans/breadcrumbs/tags are isolated across requests | ||
app.use(Sentry.Handlers.requestHandler()); | ||
// TracingHandler creates a trace for every incoming request | ||
app.use(Sentry.Handlers.tracingHandler()); | ||
``` | ||
|
||
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> in order for distributed tracing to work. |
10 changes: 10 additions & 0 deletions
10
src/platform-includes/distributed-tracing/limiting-traces/javascript.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
```javascript | ||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
integrations: [new Sentry.BrowserTracing()], | ||
tracePropagationTargets: [ | ||
"https://myproject.org", | ||
"https://.*.otherservice.org/.*", | ||
], | ||
}); | ||
``` |
9 changes: 9 additions & 0 deletions
9
src/platform-includes/distributed-tracing/limiting-traces/node.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
```javascript | ||
Sentry.init({ | ||
dsn: "___PUBLIC_DSN___", | ||
tracePropagationTargets: [ | ||
"https://myproject.org", | ||
"https://.*.otherservice.org/.*", | ||
], | ||
}); | ||
``` |
2d224d9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sentry-docs – ./
sentry-docs-git-master.sentry.dev
docs.sentry.io
sentry-docs.sentry.dev