Skip to content

Commit ec76729

Browse files
authored
docs(node): Unify "Set Up Tracing" (#12394)
* docs(node): Unify "Set Up Tracing" * add link with "not-supported" wrapper * fix 404 issues
1 parent ec89aae commit ec76729

File tree

9 files changed

+46
-194
lines changed

9 files changed

+46
-194
lines changed

docs/platforms/javascript/common/tracing/index.mdx

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@ sidebar_order: 4000
66

77
With [tracing](/product/performance/), Sentry tracks your software performance, measuring metrics like throughput and latency, and displaying the impact of errors across multiple systems. Sentry captures distributed traces consisting of transactions and spans, which measure individual services and individual operations within those services. Learn more about our model in [Distributed Tracing](/product/sentry-basics/tracing/distributed-tracing/).
88

9-
<PlatformCategorySection supported={["server", "serverless"]}>
10-
<Note>
11-
12-
If you’re adopting Tracing in a high-throughput environment, we recommend testing prior to deployment to ensure that your service’s performance characteristics maintain expectations.
13-
14-
</Note>
15-
16-
<PlatformSection
17-
notSupported={["javascript.deno", "javascript.bun", "javascript.cloudflare"]}
18-
>
19-
<Alert level="note">
20-
Sentry can integrate with <strong>OpenTelemetry</strong>. You can find more
21-
information about it
22-
<PlatformLink to="/opentelemetry/">here</PlatformLink>.
23-
</Alert>
9+
<PlatformSection notSupported={["javascript.bun", "javascript.deno", "javascript.cloudflare", "javascript.cordova", "javascript.capacitor"]}>
10+
You can additionally <PlatformLink to="/profiling">set up Profiling</PlatformLink> to get even more detailed tracing information like stack traces and flame graphs.
2411
</PlatformSection>
2512

13+
<PlatformCategorySection supported={["server", "serverless"]}>
14+
<Note>
15+
If you’re adopting Tracing in a high-throughput environment, we recommend testing prior to deployment to ensure that your service’s performance characteristics maintain expectations.
16+
</Note>
17+
18+
<PlatformSection notSupported={["javascript.deno", "javascript.bun", "javascript.cloudflare"]}>
19+
<Alert level="note">
20+
Sentry can integrate with <strong>OpenTelemetry</strong>. You can find more
21+
information about it
22+
<PlatformLink to="/opentelemetry/">here</PlatformLink>.
23+
</Alert>
24+
</PlatformSection>
2625
</PlatformCategorySection>
2726

2827
<PlatformContent supported={['javascript']}>
@@ -65,6 +64,18 @@ While you're testing, set <PlatformIdentifier name="traces-sample-rate" /> to `1
6564

6665
If you leave your sample rate at `1.0`, a transaction will be sent every time a user loads a page or navigates within your app. Depending on the amount of traffic your application gets, this may mean a lot of transactions. If you have a high-load, backend application, you may want to consider setting a lower <PlatformIdentifier name="traces-sample-rate" /> value, or switching to using <PlatformIdentifier name="traces-sampler" /> to selectively sample and filter your transactions, based on contextual data.
6766

67+
<PlatformSection notSupported={["javascript.cordova"]}>
68+
## Automatic Instrumentation
69+
70+
See <PlatformLink to="/tracing/instrumentation/automatic-instrumentation">Automatic Instrumentation</PlatformLink> to learn about all the things that the SDK automatically instruments for you.
71+
</PlatformSection>
72+
73+
## Custom Instrumentation
74+
75+
You can also manually start spans to instrument specific parts of your code. This is useful when you want to measure the performance of a specific operation or function.
76+
77+
See <PlatformLink to="/tracing/instrumentation/custom-instrumentation">Custom Instrumentation</PlatformLink> to learn how to manually start spans.
78+
6879
## Next Steps
6980

7081
<PageGrid />

docs/platforms/javascript/guides/connect/tracing/index.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/platforms/javascript/guides/express/tracing/index.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/platforms/javascript/guides/fastify/tracing/index.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/platforms/javascript/guides/hapi/tracing/index.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/platforms/javascript/guides/koa/tracing/index.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/platforms/javascript/guides/nestjs/tracing/index.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/platforms/javascript/guides/node/tracing/index.mdx

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,29 @@
1-
```javascript {tabTitle: JavaScript}
1+
```javascript {tabTitle:CommonJS} {filename: instrument.js} {8,11}
2+
const Sentry = require("@sentry/node");
3+
4+
Sentry.init({
5+
dsn: "___PUBLIC_DSN___",
6+
7+
// Add Tracing by setting tracesSampleRate
8+
// We recommend adjusting this value in production
9+
tracesSampleRate: 1.0,
10+
11+
// Alternatively, to control sampling dynamically
12+
// tracesSampler: samplingContext => { /* ... */ }
13+
});
14+
```
15+
16+
```javascript {tabTitle:ESM} {filename: instrument.mjs} {8,11}
217
import * as Sentry from "@sentry/node";
318

419
Sentry.init({
520
dsn: "___PUBLIC_DSN___",
621

7-
// To set a uniform sample rate
8-
tracesSampleRate: 0.2
22+
// Add Tracing by setting tracesSampleRate
23+
// We recommend adjusting this value in production
24+
tracesSampleRate: 1.0,
925

1026
// Alternatively, to control sampling dynamically
11-
tracesSampler: samplingContext => { ... }
27+
// tracesSampler: samplingContext => { /* ... */ }
1228
});
1329
```

0 commit comments

Comments
 (0)