Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(js): Add js tracing without performance docs #7421

Merged
merged 4 commits into from
Jul 17, 2023
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
@@ -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.
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.
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.
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 src/platform-includes/distributed-tracing/how-to-use/node.mdx
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.
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/.*",
],
});
```
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/.*",
],
});
```