From 57a73cfa5fa83f16c8575adf8b59f9c48ed33884 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Tue, 17 Sep 2024 10:42:23 -0400 Subject: [PATCH 1/8] ref: document all profiler runtime flags --- .../guides/aws-lambda/profiling/index.mdx | 26 ++++++++++++++----- .../azure-functions/profiling/index.mdx | 26 ++++++++++++++----- .../guides/connect/profiling/index.mdx | 26 ++++++++++++++----- .../guides/express/profiling/index.mdx | 26 ++++++++++++++----- .../guides/fastify/profiling/index.mdx | 26 ++++++++++++++----- .../guides/gcp-functions/profiling/index.mdx | 26 ++++++++++++++----- .../javascript/guides/koa/profiling/index.mdx | 26 ++++++++++++++----- .../guides/node/profiling/index.mdx | 25 +++++++++++++----- 8 files changed, 159 insertions(+), 48 deletions(-) diff --git a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx index 631c73b224ad0..5880392a3a226 100644 --- a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx @@ -73,17 +73,31 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -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.) +There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. -Here's an example of starting a server with lazy logging mode: +These flags are for advanced used cases and setting them is not required in majority of the cases. -```bash -# Run profiler in lazy mode -SENTRY_PROFILER_LOGGING_MODE=lazy node server.js -``` +- SENTRY_PROFILER_BINARY_PATH + + This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. +- 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. + +- 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.) + + 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. + ## Precompiled Binaries Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: diff --git a/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx b/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx index cd1d0e47263a7..39ad87ce6115f 100644 --- a/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx +++ b/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx @@ -73,17 +73,31 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -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.) +There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. -Here's an example of starting a server with lazy logging mode: +These flags are for advanced used cases and setting them is not required in majority of the cases. -```bash -# Run profiler in lazy mode -SENTRY_PROFILER_LOGGING_MODE=lazy node server.js -``` +- SENTRY_PROFILER_BINARY_PATH + + This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. +- 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. + +- 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.) + + 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. + ## Precompiled Binaries Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: diff --git a/docs/platforms/javascript/guides/connect/profiling/index.mdx b/docs/platforms/javascript/guides/connect/profiling/index.mdx index cd1d0e47263a7..39ad87ce6115f 100644 --- a/docs/platforms/javascript/guides/connect/profiling/index.mdx +++ b/docs/platforms/javascript/guides/connect/profiling/index.mdx @@ -73,17 +73,31 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -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.) +There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. -Here's an example of starting a server with lazy logging mode: +These flags are for advanced used cases and setting them is not required in majority of the cases. -```bash -# Run profiler in lazy mode -SENTRY_PROFILER_LOGGING_MODE=lazy node server.js -``` +- SENTRY_PROFILER_BINARY_PATH + + This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. +- 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. + +- 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.) + + 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. + ## Precompiled Binaries Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: diff --git a/docs/platforms/javascript/guides/express/profiling/index.mdx b/docs/platforms/javascript/guides/express/profiling/index.mdx index cd1d0e47263a7..39ad87ce6115f 100644 --- a/docs/platforms/javascript/guides/express/profiling/index.mdx +++ b/docs/platforms/javascript/guides/express/profiling/index.mdx @@ -73,17 +73,31 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -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.) +There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. -Here's an example of starting a server with lazy logging mode: +These flags are for advanced used cases and setting them is not required in majority of the cases. -```bash -# Run profiler in lazy mode -SENTRY_PROFILER_LOGGING_MODE=lazy node server.js -``` +- SENTRY_PROFILER_BINARY_PATH + + This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. +- 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. + +- 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.) + + 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. + ## Precompiled Binaries Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: diff --git a/docs/platforms/javascript/guides/fastify/profiling/index.mdx b/docs/platforms/javascript/guides/fastify/profiling/index.mdx index cd1d0e47263a7..39ad87ce6115f 100644 --- a/docs/platforms/javascript/guides/fastify/profiling/index.mdx +++ b/docs/platforms/javascript/guides/fastify/profiling/index.mdx @@ -73,17 +73,31 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -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.) +There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. -Here's an example of starting a server with lazy logging mode: +These flags are for advanced used cases and setting them is not required in majority of the cases. -```bash -# Run profiler in lazy mode -SENTRY_PROFILER_LOGGING_MODE=lazy node server.js -``` +- SENTRY_PROFILER_BINARY_PATH + + This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. +- 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. + +- 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.) + + 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. + ## Precompiled Binaries Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: diff --git a/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx b/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx index 72d05d61c446e..33bb0b319b45d 100644 --- a/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx +++ b/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx @@ -73,17 +73,31 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -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.) +There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. -Here's an example of starting a server with lazy logging mode: +These flags are for advanced used cases and setting them is not required in majority of the cases. -```bash -# Run profiler in lazy mode -SENTRY_PROFILER_LOGGING_MODE=lazy node server.js -``` +- SENTRY_PROFILER_BINARY_PATH + + This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. +- 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. + +- 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.) + + 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. + ## Precompiled Binaries Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: diff --git a/docs/platforms/javascript/guides/koa/profiling/index.mdx b/docs/platforms/javascript/guides/koa/profiling/index.mdx index cd1d0e47263a7..39ad87ce6115f 100644 --- a/docs/platforms/javascript/guides/koa/profiling/index.mdx +++ b/docs/platforms/javascript/guides/koa/profiling/index.mdx @@ -73,17 +73,31 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -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.) +There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. -Here's an example of starting a server with lazy logging mode: +These flags are for advanced used cases and setting them is not required in majority of the cases. -```bash -# Run profiler in lazy mode -SENTRY_PROFILER_LOGGING_MODE=lazy node server.js -``` +- SENTRY_PROFILER_BINARY_PATH + + This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. +- 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. + +- 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.) + + 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. + ## Precompiled Binaries Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: diff --git a/docs/platforms/javascript/guides/node/profiling/index.mdx b/docs/platforms/javascript/guides/node/profiling/index.mdx index 320fc426227b6..d3835eac07f4f 100644 --- a/docs/platforms/javascript/guides/node/profiling/index.mdx +++ b/docs/platforms/javascript/guides/node/profiling/index.mdx @@ -133,14 +133,27 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -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.) +There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. -Here's an example of starting a server with lazy logging mode: +These flags are for advanced used cases and setting them is not required in majority of the cases. -```bash -# Run profiler in lazy mode -SENTRY_PROFILER_LOGGING_MODE=lazy node server.js -``` +- SENTRY_PROFILER_BINARY_PATH + + This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. +- 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. + +- 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.) + + 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. From 65df7717a23d9a3ac2ef320a1ddf8ababb3162d8 Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 19 Sep 2024 09:35:32 -0400 Subject: [PATCH 2/8] Update docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com> --- docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx index 5880392a3a226..d46455510e426 100644 --- a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx @@ -73,7 +73,7 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes ## Runtime Flags -There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. +There are three runtime flags that you can set which control the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. These flags are for advanced used cases and setting them is not required in majority of the cases. From 31257de9c93eb0c3ec5ac57790f4319630bc0239 Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 19 Sep 2024 09:35:44 -0400 Subject: [PATCH 3/8] Update docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com> --- docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx index d46455510e426..1826a9127e56a 100644 --- a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx @@ -79,7 +79,7 @@ These flags are for advanced used cases and setting them is not required in majo - SENTRY_PROFILER_BINARY_PATH - This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. + 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. From d6129eddb9732934472b2cc3300d8f9d7252e47e Mon Sep 17 00:00:00 2001 From: JonasBa Date: Thu, 19 Sep 2024 09:37:59 -0400 Subject: [PATCH 4/8] use note for advanced use case warning --- docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx index 1826a9127e56a..76aa7b134b691 100644 --- a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx @@ -75,7 +75,9 @@ Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodes There are three runtime flags that you can set which control the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. + These flags are for advanced used cases and setting them is not required in majority of the cases. + - SENTRY_PROFILER_BINARY_PATH From 503bbf621bf53cfc773360559f1bd79285746cd4 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Thu, 19 Sep 2024 09:52:37 -0400 Subject: [PATCH 5/8] use include --- .../guides/aws-lambda/profiling/index.mdx | 29 +------------------ .../azure-functions/profiling/index.mdx | 27 +---------------- .../guides/connect/profiling/index.mdx | 27 +---------------- .../guides/express/profiling/index.mdx | 27 +---------------- .../guides/fastify/profiling/index.mdx | 27 +---------------- .../guides/gcp-functions/profiling/index.mdx | 27 +---------------- .../guides/hapi/profiling/index.mdx | 13 +-------- .../javascript/guides/koa/profiling/index.mdx | 27 +---------------- .../guides/nestjs/profiling/index.mdx | 13 +-------- .../guides/node/profiling/index.mdx | 26 +---------------- includes/profiling-node-runtime-flags.mdx | 28 ++++++++++++++++++ 11 files changed, 38 insertions(+), 233 deletions(-) create mode 100644 includes/profiling-node-runtime-flags.mdx diff --git a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx index 76aa7b134b691..471e531a5b780 100644 --- a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx @@ -71,34 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -There are three runtime flags that you can set which control the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. - - -These flags are for advanced used cases and setting them is not required in majority of the cases. - - -- 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. -- 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. - -- 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.) - - 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. - + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx b/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx index 39ad87ce6115f..16308479c44ef 100644 --- a/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx +++ b/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx @@ -71,32 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. - -These flags are for advanced used cases and setting them is not required in majority of the cases. - -- SENTRY_PROFILER_BINARY_PATH - - This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. -- 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. - -- 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.) - - 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. - + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/connect/profiling/index.mdx b/docs/platforms/javascript/guides/connect/profiling/index.mdx index 39ad87ce6115f..16308479c44ef 100644 --- a/docs/platforms/javascript/guides/connect/profiling/index.mdx +++ b/docs/platforms/javascript/guides/connect/profiling/index.mdx @@ -71,32 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. - -These flags are for advanced used cases and setting them is not required in majority of the cases. - -- SENTRY_PROFILER_BINARY_PATH - - This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. -- 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. - -- 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.) - - 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. - + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/express/profiling/index.mdx b/docs/platforms/javascript/guides/express/profiling/index.mdx index 39ad87ce6115f..16308479c44ef 100644 --- a/docs/platforms/javascript/guides/express/profiling/index.mdx +++ b/docs/platforms/javascript/guides/express/profiling/index.mdx @@ -71,32 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. - -These flags are for advanced used cases and setting them is not required in majority of the cases. - -- SENTRY_PROFILER_BINARY_PATH - - This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. -- 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. - -- 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.) - - 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. - + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/fastify/profiling/index.mdx b/docs/platforms/javascript/guides/fastify/profiling/index.mdx index 39ad87ce6115f..16308479c44ef 100644 --- a/docs/platforms/javascript/guides/fastify/profiling/index.mdx +++ b/docs/platforms/javascript/guides/fastify/profiling/index.mdx @@ -71,32 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. - -These flags are for advanced used cases and setting them is not required in majority of the cases. - -- SENTRY_PROFILER_BINARY_PATH - - This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. -- 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. - -- 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.) - - 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. - + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx b/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx index 33bb0b319b45d..a64aa6ce254e5 100644 --- a/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx +++ b/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx @@ -71,32 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. - -These flags are for advanced used cases and setting them is not required in majority of the cases. - -- SENTRY_PROFILER_BINARY_PATH - - This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. -- 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. - -- 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.) - - 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. - + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/hapi/profiling/index.mdx b/docs/platforms/javascript/guides/hapi/profiling/index.mdx index cd1d0e47263a7..16308479c44ef 100644 --- a/docs/platforms/javascript/guides/hapi/profiling/index.mdx +++ b/docs/platforms/javascript/guides/hapi/profiling/index.mdx @@ -71,18 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -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: - -```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. + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/koa/profiling/index.mdx b/docs/platforms/javascript/guides/koa/profiling/index.mdx index 39ad87ce6115f..16308479c44ef 100644 --- a/docs/platforms/javascript/guides/koa/profiling/index.mdx +++ b/docs/platforms/javascript/guides/koa/profiling/index.mdx @@ -71,32 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. - -These flags are for advanced used cases and setting them is not required in majority of the cases. - -- SENTRY_PROFILER_BINARY_PATH - - This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. -- 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. - -- 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.) - - 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. - + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/nestjs/profiling/index.mdx b/docs/platforms/javascript/guides/nestjs/profiling/index.mdx index 0a5ef82fc99ae..6c872ec942f17 100644 --- a/docs/platforms/javascript/guides/nestjs/profiling/index.mdx +++ b/docs/platforms/javascript/guides/nestjs/profiling/index.mdx @@ -71,18 +71,7 @@ Sentry.startSpan( Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -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: - -```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. + ## Precompiled Binaries diff --git a/docs/platforms/javascript/guides/node/profiling/index.mdx b/docs/platforms/javascript/guides/node/profiling/index.mdx index d3835eac07f4f..71d28898152e7 100644 --- a/docs/platforms/javascript/guides/node/profiling/index.mdx +++ b/docs/platforms/javascript/guides/node/profiling/index.mdx @@ -131,31 +131,7 @@ Continuous profiling has implications for your org's billing structure. This fea Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. -## Runtime Flags - -There are three runtime flags that you can set which the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. - -These flags are for advanced used cases and setting them is not required in majority of the cases. - -- SENTRY_PROFILER_BINARY_PATH - - This flag sets the profiler binary path and bypasses arch, platform and libc checks. It is useful if you want to override which binary is required at runtime, which can be useful in some build configurations. -- 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. - -- 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.) - - 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. + ## Precompiled Binaries diff --git a/includes/profiling-node-runtime-flags.mdx b/includes/profiling-node-runtime-flags.mdx new file mode 100644 index 0000000000000..82bd6ed6225c5 --- /dev/null +++ b/includes/profiling-node-runtime-flags.mdx @@ -0,0 +1,28 @@ + +## Runtime Flags + +There are three runtime flags that you can set which control the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. + + +These flags are for advanced used cases and setting them is not required in majority of the cases. + + +- 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. +- 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. + +- 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.) + + 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. From 574862ff297693af015a5fac9446253cfb569834 Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 19 Sep 2024 14:55:07 -0400 Subject: [PATCH 6/8] Update includes/profiling-node-runtime-flags.mdx Co-authored-by: Liza Mock --- includes/profiling-node-runtime-flags.mdx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/profiling-node-runtime-flags.mdx b/includes/profiling-node-runtime-flags.mdx index 82bd6ed6225c5..62fd0377b934a 100644 --- a/includes/profiling-node-runtime-flags.mdx +++ b/includes/profiling-node-runtime-flags.mdx @@ -1,10 +1,9 @@ ## Runtime Flags - -There are three runtime flags that you can set which control the behavior of the profiler. Two of the flags relate to how the SDK resolves the profiler binaries and another flag which alters how the underlying profiler is initialized by v8. +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. -These flags are for advanced used cases and setting them is not required in majority of the cases. +These flags are intended for advanced use cases only. Setting them isn't required for most use cases. - SENTRY_PROFILER_BINARY_PATH From 2ccdfbe862c603e1be20d459c1838685ebba56f5 Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 19 Sep 2024 14:55:24 -0400 Subject: [PATCH 7/8] Update includes/profiling-node-runtime-flags.mdx Co-authored-by: Liza Mock --- includes/profiling-node-runtime-flags.mdx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/profiling-node-runtime-flags.mdx b/includes/profiling-node-runtime-flags.mdx index 62fd0377b934a..eb39816e644be 100644 --- a/includes/profiling-node-runtime-flags.mdx +++ b/includes/profiling-node-runtime-flags.mdx @@ -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. From f0bda97903ca7d30616a77d77ad919f6f86ff394 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Thu, 19 Sep 2024 16:13:31 -0400 Subject: [PATCH 8/8] link to v8 --- includes/profiling-node-runtime-flags.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/profiling-node-runtime-flags.mdx b/includes/profiling-node-runtime-flags.mdx index eb39816e644be..c4c6e165207b8 100644 --- a/includes/profiling-node-runtime-flags.mdx +++ b/includes/profiling-node-runtime-flags.mdx @@ -1,6 +1,6 @@ ## Runtime Flags -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. +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/). These flags are intended for advanced use cases only. Setting them isn't required for most use cases. @@ -9,7 +9,7 @@ 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. - + - SENTRY_PROFILER_BINARY_DIR 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.