From a4600b8fe757928dc7845d5ac21e10253fede35b Mon Sep 17 00:00:00 2001 From: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> Date: Mon, 19 Aug 2024 08:23:01 -0700 Subject: [PATCH] Add new env vars (#1481) (cherry picked from commit 643a055712339f0c5a8ce83ba6d32e1e3fc09764) --- .../reference/cli/environment-variables.md | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/sources/reference/cli/environment-variables.md b/docs/sources/reference/cli/environment-variables.md index a7d80f8d04..3eebbce3ef 100644 --- a/docs/sources/reference/cli/environment-variables.md +++ b/docs/sources/reference/cli/environment-variables.md @@ -14,14 +14,14 @@ The following environment variables are supported: * `GODEBUG` * `HTTP_PROXY` +* `PPROF_MUTEX_PROFILING_PERCENT` +* `PPROF_BLOCK_PROFILING_RATE` Refer to the [Go runtime][runtime] documentation for more information about Go runtime environment variables. -## Arguments +## GODEBUG -The following arguments are supported. - -### GODEBUG +You can use the `GODEBUG` environment variable to control the debugging variables within the Go runtime. The following arguments are supported. Argument | Description | Default --------------------------------|------------------------------------------------------------------------------------------------------|-------- @@ -29,10 +29,20 @@ Argument | Description `netdns` | Force a resolver. Set to `go` for a pure Go resolver. Set to `cgo` or `win32` for a native resolver. | `netdns` | Show resolver debugging information. Set to `1` for basic information. Set to `2` for verbose. | -### HTTP_PROXY +## HTTP_PROXY + +You can use the `HTTP_PROXY` environment variable to define the hostname or IP address of the proxy server. For example, you can set the proxy to `http://proxy.example.com`. + +## PPROF_MUTEX_PROFILING_PERCENT + +You can use the `PPROF_MUTEX_PROFILING_PERCENT` environment variable to define the percentage of mutex profiles to retrieve from the pprof mutex endpoint. If you set this variable to `5`, then 5 percent of the mutexes are sampled. The default value is `0.01`. + +## PPROF_BLOCK_PROFILING_RATE + +You can use the `PPROF_BLOCK_PROFILING_RATE` environment variable to define the rate that mutexes are tracked. You can use the following values with this environment variable. The default value is `10000`. -Argument | Description | Default ----------------------------|-------------------------------------------------|-------- -`http://proxy.example.com` | The hostname or IP address of the proxy server. | +* `0`: Nothing is tracked. +* `1`: All mutexes are tracked. +* A value greater than `1`: The number of nanoseconds to track mutexes. [runtime]: https://pkg.go.dev/runtime