Skip to content

Commit

Permalink
Update includes/profiling-node-runtime-flags.mdx
Browse files Browse the repository at this point in the history
Co-authored-by: Liza Mock <[email protected]>
  • Loading branch information
JonasBa and lizokm committed Sep 19, 2024
1 parent 574862f commit 2ccdfbe
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions includes/profiling-node-runtime-flags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@ These flags are intended for advanced use cases only. Setting them isn't require

- SENTRY_PROFILER_BINARY_PATH

This flag sets the profiler binary path and bypasses arch, platform and libc checks. It can be useful in some build configurations if you want to override which binary is required at runtime.
This flag sets the profiler binary path and bypasses arch, platform, and libc checks. It can be useful in some build configurations if you want to override which binary is required at runtime.

- SENTRY_PROFILER_BINARY_DIR

Acts similarly as the flag above, however this flag only specifies the directory where the binaries are located and defers to the runtime to resolve the correct binary depending on the arch, platform and libc version.
Acts similarly to the flag above, however, this flag only specifies the directory where the binaries are located and defers to the runtime to resolve the correct binary depending on the arch, platform, and libc version.

- SENTRY_PROFILER_LOGGING_MODE

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.)
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.)

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

```bash
# Run profiler in lazy mode
SENTRY_PROFILER_LOGGING_MODE=lazy node server.js
```

We recommend you have your own CPU resource-monitoring in place, because the actual resource use could be environment-dependent.

0 comments on commit 2ccdfbe

Please sign in to comment.