docs/src/data/experiments/profiling.mdx
Collect CPU profiles, memory (heap) profiles, and goroutine profiles for Terragrunt.
profiling - What it doesWhen enabled, Terragrunt allows collecting runtime profiles using CLI flags (or the corresponding TG_PROFILE_* environment variables):
--profile-cpu / TG_PROFILE_CPU: write a CPU profile--profile-mem / TG_PROFILE_MEM: write a heap memory profile--profile-goroutine / TG_PROFILE_GOROUTINE: write a goroutine profile (stack traces of all goroutines)--profile-dir / TG_PROFILE_DIR: collect all of the above into a single directory using conventional filenamesExample:
terragrunt --experiment=profiling --profile-dir /tmp/profiles run --all -- plan
This is primarily intended for performance investigation and debugging of Terragrunt itself.
The experiment can also be enabled with TG_EXPERIMENT=profiling, which is convenient when driving profiling entirely through environment variables.
profiling - How to provide feedbackProvide feedback on the Terragrunt GitHub Discussions or by opening an issue.
profiling - Criteria for stabilizationTo transition the profiling experiment to a stable release, the following should be addressed:
--profile-*).--experiment-mode and TG_EXPERIMENT is ergonomic.