Go 1.25 Introduces Flight Recorder for Real-Time Execution Tracing
By
<h2>Go 1.25 Introduces Flight Recorder for Real-Time Execution Tracing</h2>
<p><strong>September 26, 2025</strong> — The Go team announced today that Go 1.25 includes a built-in flight recorder for runtime execution traces, giving developers a powerful new way to diagnose production issues without pre-planning or massive data collection.</p><figure style="margin:20px 0"><img src="flight-recorder/flight_recorder_1.png" alt="Go 1.25 Introduces Flight Recorder for Real-Time Execution Tracing" style="width:100%;height:auto;border-radius:8px" loading="lazy"><figcaption style="font-size:12px;color:#666;margin-top:5px">Source: blog.golang.org</figcaption></figure>
<p>The flight recorder continuously buffers the last few seconds of a Go program's execution trace in memory. When a problem is detected—such as a timeout or health check failure—developers can request a snapshot of exactly the problematic window, rather than capturing an entire trace or relying on random sampling.</p>
<p>“This is like having a black box for your Go services,” said Carlos Amedee, a Go team engineer. “You don't need to start recording ahead of time; the recorder is always ready, and you grab the tape after the incident.”</p>
<h3 id="execution-traces">A Quick Look at Execution Traces</h3>
<p>Go execution traces are detailed logs produced by the runtime that capture goroutine scheduling, system calls, and other low-level events. They help developers understand why goroutines are executing or, crucially, why they are not—making them essential for debugging latency issues.</p>
<p>Previously, collecting a trace required explicit <code>Start</code> and <code>Stop</code> calls via the <code>runtime/trace</code> package. This worked fine for tests or short-lived tools, but long-running web services—Go's bread and butter—could not afford to record all activity.</p>
<p>“A web server might be up for weeks,” said Michael Knyszek, also on the Go team. “Collecting an end-to-end trace would produce terabytes of data that is mostly noise. The flight recorder changes that dynamic completely.”</p>
<h3 id="background">Background: The Problem with Pre-Planned Tracing</h3>
<p>Before Go 1.25, engineers had two main options for tracing in production: continuous collection or random sampling. Both come with significant drawbacks.</p><figure style="margin:20px 0"><img src="https://go.dev/images/google-white.png" alt="Go 1.25 Introduces Flight Recorder for Real-Time Execution Tracing" style="width:100%;height:auto;border-radius:8px" loading="lazy"><figcaption style="font-size:12px;color:#666;margin-top:5px">Source: blog.golang.org</figcaption></figure>
<ul>
<li><strong>Continuous collection</strong> requires infrastructure to store, triage, and process large volumes of data—most of which contains nothing interesting.</li>
<li><strong>Random sampling</strong> can catch anomalies but demands heavy data pipelines and may miss rare, critical events.</li>
</ul>
<p>Neither approach helps when a specific issue (like a request timeout) occurs without warning. By the time a problem is noticed, it is already too late to start tracing. The flight recorder solves this by maintaining a rolling buffer that can be frozen on demand.</p>
<h3 id="what-this-means">What This Means for Go Developers</h3>
<p>The flight recorder is a precision diagnostic tool. “It's like a scalpel cutting directly to the problem area,” Knyszek explained. “Instead of drowning in data, you get exactly the seconds that matter.”</p>
<p>This feature is particularly valuable for microservices and web applications where latency spikes or failures are transient. Developers can now add a simple API call to snapshot the trace when error conditions are met, dramatically reducing mean time to resolution (MTTR).</p>
<p>Go 1.25 also improves the underlying execution tracer performance, so enabling flight recording has minimal overhead. The buffer size is configurable, allowing teams to balance memory usage against trace depth.</p>
<p>The flight recorder is available starting with Go 1.25. For more details, see the <a href="#">official documentation</a> and <a href="#">the Go Blog post</a>.</p>