diff --git a/src/gitlab-tofu.sh b/src/gitlab-tofu.sh
index d95f0fcb7bc0fbaf346a548e9faf30cfb341b688..660ede8ef35f8ed16459909e73c18cd967d7acbf 100644
--- a/src/gitlab-tofu.sh
+++ b/src/gitlab-tofu.sh
@@ -11,6 +11,7 @@
 #
 # Respected Environment Variables:
 # --------------------------------
+# GITLAB_TOFU_DEBUG: if set to true will enable xtrace.
 # GITLAB_TOFU_SOURCE: forces this script in source-mode. Required when source auto-detection fails.
 # GITLAB_TOFU_APPLY_NO_PLAN: if set to true, the apply command does not use a plan cache file.
 # GITLAB_TOFU_PLAN_NAME: the name of the plan cache and json files. Defaults to `plan`.
@@ -42,7 +43,7 @@
 # set some shell options
 set -o errexit
 
-if [ "${DEBUG_OUTPUT}" = "true" ]; then
+if [ "${GITLAB_TOFU_DEBUG}" = "true" ]; then
     set -o xtrace
 fi
 
diff --git a/tests/unit/gitlab-tofu.bats b/tests/unit/gitlab-tofu.bats
index e655ab9faa05712152b1ecc301765042e093c819..75e34d2ddcf639abd6726e982a4f3abceb891bdf 100644
--- a/tests/unit/gitlab-tofu.bats
+++ b/tests/unit/gitlab-tofu.bats
@@ -7,7 +7,7 @@ load "$BATS_LIBS/bats-support/load"
 load "$BATS_LIBS/bats-assert/load"
 
 setup() {
-  export DEBUG_OUTPUT=true
+  export GITLAB_TOFU_DEBUG=true
 
   # Change cwd to test specific directory
   cd "$BATS_TEST_TMPDIR"