diff --git a/src/core/lib/profiling/basic_timers.c b/src/core/lib/profiling/basic_timers.c
index c4f2772822763f0d19f41a5917aa9e3c216fa485..1fbc9d7023d4981e3c8ecd6cba6f8349ae178675 100644
--- a/src/core/lib/profiling/basic_timers.c
+++ b/src/core/lib/profiling/basic_timers.c
@@ -90,7 +90,8 @@ static int g_writing_enabled = 1;
 static const char *output_filename() {
   if (output_filename_or_null == NULL) {
     output_filename_or_null = gpr_getenv("LATENCY_TRACE");
-    if (output_filename_or_null == NULL) {
+    if (output_filename_or_null == NULL ||
+        strlen(output_filename_or_null) == 0) {
       output_filename_or_null = "latency_trace.txt";
     }
   }