Skip to content

Commit 0b29d10

Browse files
authored
ref(profiling) fix method name (#12078)
1 parent 78036dc commit 0b29d10

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

docs/product/explore/profiling/transaction-vs-continuous-profiling.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Continuous profiling mode is capable of profiling long-running workflows or proc
2828

2929
## SDK Differences
3030

31-
Transaction-based profiling was opaque from the SDK side, with the SDK being in full control of when the profiler would start and stop based on the transactions it generated. In continuous profiling mode, this is no longer true. Developers can now control when the profiler is started or stopped via new top-level SDK methods. The exact method-naming varies, but most SDKs that support continuous profiling now expose a top level `Sentry.profiler` that exposes a `startProfiling` and `stopProfiling` method. (Please see the SDK docs for exact definitions.)
31+
Transaction-based profiling was opaque from the SDK side, with the SDK being in full control of when the profiler would start and stop based on the transactions it generated. In continuous profiling mode, this is no longer true. Developers can now control when the profiler is started or stopped via new top-level SDK methods. The exact method-naming varies, but most SDKs that support continuous profiling now expose a top level `Sentry.profiler` that exposes a `startProfiler` and `stopProfiler` method. (Please see the SDK docs for exact definitions.)
3232

33-
We recommend that you call the `startProfiling` method right after the Sentry SDK is initialized so that you gain visibility at the earliest point in your application lifecycle. From then on, the profiler will keep collecting profiles and sending chunks to Sentry until `stopProfiling` is called.
33+
We recommend that you call the `startProfiler` method right after the Sentry SDK is initialized so that you gain visibility at the earliest point in your application lifecycle. From then on, the profiler will keep collecting profiles and sending chunks to Sentry until `stopProfiler` is called.
3434

3535
## Choosing Between Transaction and Continuous Profiling Mode
3636

@@ -46,12 +46,12 @@ Sentry.Init({
4646
integrations: [nodeProfilingIntegration()],
4747
});
4848

49-
Sentry.profiler.startProfiling();
50-
// Code executed after the first call to startProfiling will now be profiled
49+
Sentry.profiler.startProfiler();
50+
// Code executed after the first call to startProfiler will now be profiled
5151

5252
// You can stop profiling at any time by calling stopProfiling.
5353
// This can help you isolate the code you wish to profile.
54-
Sentry.profiler.stopProfiling();
54+
Sentry.profiler.stopProfiler();
5555
```
5656

5757
If you want to keep using transaction-based profiling, then the options are the same. You can set either the `profilesSampleRate` or the `profilesSampler` option on the SDK.

includes/profiling-node-runtime-flags.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
21
## Runtime Flags
2+
33
There are three runtime flags you can set that control the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries. The third alters how the underlying profiler is initialized by [v8](https://v8docs.nodesource.com/).
44

55
<Note>
@@ -16,10 +16,11 @@ Acts similarly to the flag above, however, this flag only specifies the director
1616

1717
- SENTRY_PROFILER_LOGGING_MODE
1818

19-
The default mode of the v8 CpuProfiler is [kEagerLogging](https://v8docs.nodesource.com/node-18.2/d2/dc3/namespacev8.html#a874b4921ddee43bef58d8538e3149374), which enables the profiler even when no profiles are active—this is good because it makes calls to `startProfiling` fast with the tradeoff of constant CPU overhead. This behavior can be controlled via the `SENTRY_PROFILER_LOGGING_MODE` environment variable with values of `eager|lazy`. If you opt to use the lazy-logging mode, calls to `startProfiling` may be slow. (Depending on environment and node version, it can be in the order of a few hundred ms.)
19+
The default mode of the v8 CpuProfiler is [kEagerLogging](https://v8docs.nodesource.com/node-18.2/d2/dc3/namespacev8.html#a874b4921ddee43bef58d8538e3149374), which enables the profiler even when no profiles are active—this is good because it makes calls to startProfgiler faster with the tradeoff of constant CPU overhead. This behavior can be controlled via the `SENTRY_PROFILER_LOGGING_MODE` environment variable with values of `eager|lazy`. If you opt to use the lazy-logging mode, calls to `startProfiler` may be slow. (Depending on environment and node version, it can be in the order of a few hundred ms.)
2020

2121
Here's an example of starting a server with lazy-logging mode:
2222

23-
```bash
24-
# Run profiler in lazy mode
25-
SENTRY_PROFILER_LOGGING_MODE=lazy node server.js
23+
```bash
24+
# Run profiler in lazy mode
25+
SENTRY_PROFILER_LOGGING_MODE=lazy node server.js
26+
```

0 commit comments

Comments
 (0)