SRE & Platform Engineering

How Do You Trace Go Applications to Find Performance Bottlenecks?

November 21, 2026
7
min read
SRE & Platform Engineering

Your Go service is taking longer to respond, but the CPU profile shows no obvious bottleneck. The missing time may be spent waiting on a mutex, a network response, or a chance for a goroutine to run, rather than executing code. An execution trace makes those waits visible, and go tool trace helps you identify where the time goes.

This guide shows how to capture traces from a Go program, tests, or a running service, then use the timeline and blocking profiles to identify and fix performance bottlenecks. You’ll also learn how to capture intermittent problems with Go’s flight recorder and use groundcover to identify slow requests and their service dependencies before examining the affected Go process.

What Is go tool trace and When Should You Use It?

go tool trace is Go’s browser-based viewer for execution traces recorded by the runtime. Rather than summarizing sampled activity, an execution trace records timestamped events showing how goroutines and the scheduler behave during a specific period. Most events include a stack trace, allowing you to connect runtime activity to the code involved.

The recorded events include:

  • Goroutine activity: Creation, blocking, unblocking, and scheduling.
  • System calls: When goroutines enter, exit, or block during system calls.
  • Garbage collection: GC activity, heap-size changes, and runtime pauses.
  • Processor activity: When Go’s logical processors start and stop executing goroutines.

These events form a timeline that helps you distinguish a goroutine blocked on synchronization or I/O from one that is runnable but waiting to be scheduled. You can also examine whether garbage collection coincides with a latency spike or whether work is running serially when it could execute in parallel.

go tool trace vs. go tool pprof

go tool pprof analyzes profiles that summarize where a program spends CPU time, allocates memory, or accumulates blocking time. go tool trace shows the sequence of runtime events, making it useful when you need to understand how a delay developed rather than only which functions accumulated the most cost.

QuestionUse
Which functions consume the most CPU?go tool pprof with a CPU profile
Where are memory allocations happening?go tool pprof with a heap or allocations profile
Which call stacks accumulate mutex contention?go tool pprof with a mutex or block profile
Why was a goroutine blocked at a particular moment?go tool trace
Did scheduling delays or GC activity coincide with a latency spike?go tool trace

The tools also work together. You can export network, synchronization, syscall, or scheduler blocking profiles from go tool trace and analyze them with go tool pprof. Go’s standalone block and mutex profiles require collection to be enabled, while execution tracing records the runtime events needed to investigate these waits.

How to Capture and Open a Go Execution Trace

You can capture Go execution traces from a standalone program, during tests or benchmarks, or from a running HTTP service. Each method produces a trace file that you can open with go tool trace. Choose the method based on where you can reproduce the performance problem.

Step 1: Trace a Go Program with runtime/trace

The runtime/trace package lets you record execution activity directly from your application. Calling trace.Start begins collecting runtime events and writes them to an io.Writer, such as a file. Recording continues until you call trace.Stop, which finishes writing the trace before returning.

Consider a program where eight workers update a shared cache. Each worker calls update(), which acquires a mutex before performing an expensive calculation. Because the calculation happens while the mutex is held, the other workers must wait for the lock even though they could perform their calculations independently. The following program reproduces that contention while recording its execution:

package main

import (
	"fmt"
	"log"
	"os"
	"runtime/trace"
	"sync"
	"time"
)

type cache struct {
	mu   sync.Mutex
	data map[int]int
}

// update holds the lock while it computes. This is the bottleneck.
func (c *cache) update(key int) {
	c.mu.Lock()
	defer c.mu.Unlock()
	v := expensive(key)
	c.data[key%64] += v
}

func expensive(n int) int {
	sum := 0
	for i := 0; i < 200_000; i++ {
		sum += (n * i) % 7
	}
	return sum
}

func work(c *cache) {
	var wg sync.WaitGroup
	for w := 0; w < 8; w++ {
		wg.Add(1)
		go func(id int) {
			defer wg.Done()
			for i := 0; i < 200; i++ {
				c.update(id*1000 + i)
			}
		}(w)
	}
	wg.Wait()
}

func run() error {
	f, err := os.Create("trace.out")
	if err != nil {
		return err
	}
	defer f.Close() // runs second

	if err := trace.Start(f); err != nil {
		return err
	}
	defer trace.Stop() // runs first, flushing all trace data

	c := &cache{data: make(map[int]int)}
	start := time.Now()
	work(c)
	fmt.Println("elapsed:", time.Since(start))
	return nil
}

func main() {
	if err := run(); err != nil {
		log.Fatal(err)
	}
}

The work() function starts eight goroutines, each performing 200 cache updates. A sync.WaitGroup keeps the program running until every worker finishes. Meanwhile, trace.Start(f) records scheduling and blocking activity in trace.out, including events showing when a worker waits to acquire the mutex. Notice that trace.Stop() and f.Close() are deferred in that order. Go executes deferred calls in reverse order, so tracing stops and finishes writing before the file closes. Keeping this logic in run() also ensures the deferred cleanup runs before main() handles a returned error.

Save the code as main.go and execute it:

go run main.go

The program prints an elapsed: duration and creates trace.out in the current directory. The duration measures how long work() took, while the trace contains the runtime events needed to investigate that execution. Because expensive() runs inside the critical section, the workers compete for the same mutex, creating a reproducible example of lock contention that you’ll investigate and fix later in the guide.

Step 2: Trace Tests and Benchmarks with go test -trace

You don’t need to modify application code when a performance problem can be reproduced in a test or benchmark. The go test -trace flag starts execution tracing while the test binary runs and saves the collected events to a file.

Run these commands in a Go package containing tests or benchmarks that exercise the workload you’re investigating. go test doesn’t execute the main() function from Step 1. From that package’s directory, run:

go test -trace=trace.out .

The . selects the current package, and -trace=trace.out specifies the output file. Go runs the package’s tests while recording runtime activity, then finishes writing the trace before the test binary exits. For performance investigations, benchmarks are often more useful because they repeatedly execute a particular operation. To collect a trace while running the benchmarks in the current package, use:

go test -run='^$' -bench=. -trace=bench.out .

Here, -run='^$' prevents ordinary tests from running, while -bench=. selects the package’s benchmarks. The resulting bench.out file includes runtime activity during benchmark execution, allowing you to examine contention, scheduling delays, and garbage collection under the benchmark workload. For a smaller trace, replace -bench=. with a pattern that selects the specific benchmark you’re investigating.

Keep these constraints in mind:

  • One package per run: go test -trace accepts one package at a time. Passing multiple packages, including ./... when it matches several packages, causes an error.
  • Output location: Supply an absolute path to -trace when the output must be saved to a particular directory.
  • Test caching: Runs using -trace aren’t served from Go’s test cache.
  • Capture size: A long-running benchmark can produce a large trace. Narrow the benchmark selection and duration to keep analysis manageable.

Use this method when the problem reproduces in a test environment. You can inspect the same runtime events without enabling tracing in a deployed service.

Step 3: Capture a Trace from a Running HTTP Service

For a running service, net/http/pprof provides an HTTP endpoint at /debug/pprof/trace that captures execution activity while the process continues serving requests. Importing the package registers its profiling handlers on Go’s default HTTP multiplexer, but you must also provide an HTTP listener that serves those handlers. The following example creates a dedicated profiling listener on 127.0.0.1:6060, separate from the application server on port 8080.

package main

import (
	"log"
	"net/http"
	_ "net/http/pprof"
)

func main() {
	go func() {
		// Profiling endpoints on loopback only.
		log.Println(http.ListenAndServe("127.0.0.1:6060", nil))
	}()

	// Application server on its own mux.
	mux := http.NewServeMux()
	mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("ok\n"))
	})
	log.Fatal(http.ListenAndServe(":8080", mux))
}

The blank import of net/http/pprof registers the profiling routes without requiring direct calls to the package. Passing nil to the profiling server’s ListenAndServe makes it use the default multiplexer where those routes are registered. The application uses a separate http.NewServeMux(), so its listener doesn’t serve the profiling endpoints. Binding the profiling listener to 127.0.0.1 also restricts direct access to the local machine.

Save the example as server.go and start it:

go run server.go

You can confirm the application is responding by opening http://localhost:8080/ or running:

curl http://localhost:8080/

The response should be ok. To capture five seconds of execution, open another terminal and run:

curl -o trace.out "http://localhost:6060/debug/pprof/trace?seconds=5"

The seconds=5 parameter determines how long tracing runs, and -o trace.out saves the downloaded trace in the directory where you execute curl. Without the seconds parameter, the endpoint captures one second.

The trace captures activity across the entire Go process, not just the request to the profiling endpoint. To investigate application performance, send requests to port 8080 while the five-second capture runs so their execution appears in the trace. This example only returns ok, but in a real service, the trace can show goroutines waiting on mutexes, network operations, or the scheduler during request processing. Only one trace.Start capture can run at a time, so overlapping capture requests return HTTP 500 with a Could not enable tracing error. Go’s flight recorder can run alongside one active trace.Start capture.

Keep the profiling listener bound to loopback or protected by appropriate access controls. Exposing /debug/pprof publicly can reveal details about your application’s execution, so use an SSH tunnel or another secured access method when collecting traces remotely.

Step 4: Open the Trace with go tool trace

Once you have a trace file, open it with:

go tool trace trace.out

Run this command from the directory containing trace.out, or pass the file’s full path. go tool trace parses the recorded events, starts a local HTTP server, and opens its web interface. If your browser doesn’t launch automatically, copy the URL printed in the terminal.

You can also specify the address and port used by the viewer:

go tool trace -http=127.0.0.1:6061 trace.out

This starts the viewer on port 6061, avoiding a conflict with the example application on port 8080 and its profiling listener on 6060. The viewer provides processor and thread timelines, goroutine analysis, blocking profiles, and garbage collection information. Start with the processor timeline to examine when goroutines execute and when they stop running. If the timeline shows significant waiting, use the blocking profiles to identify the operations and call stacks contributing to that delay.

Use Chrome or Chromium for the execution trace viewer. Its timeline interface is actively tested in those browsers, although the profile pages also work in other browsers.

How to Read the go tool trace Web UI

Running go tool trace trace.out opens the trace viewer’s index page, where you can choose between processor timelines, goroutine analysis, blocking profiles, and garbage collection metrics. Select View trace by proc to open the execution timeline and examine when goroutines run or stop making progress. From there, you can inspect individual goroutines and use blocking profiles to identify the call stacks responsible for delays.

Figure: Go trace viewer index showing links to processor timelines and goroutine analysis

View Trace by Proc and by Thread

Select View trace by proc to examine how goroutines execute across Go’s logical processors, called Ps. Each P represents a resource the Go scheduler uses to execute goroutines on operating system threads (Ms). The timeline shows which goroutine was running on each P and when it stopped. If you’re using a trace produced by Go 1.22 or later, View trace by thread provides a similar timeline organized by OS thread, which helps when investigating system calls or cgo activity.

Figure: Processor timeline showing how goroutines execute across Go logical processors

Each colored segment represents a period during which a goroutine was executing. Click a segment to inspect its duration, related events, and stack trace.

Figure: Selected worker span displaying its mutex lock stack trace

You can also enable Flow Events to see causal connections between execution segments, including when one goroutine unblocks another. These connections are useful when a worker stops running because it is waiting for another goroutine to release a mutex or send data through a channel.

The STATS area contains timelines for goroutine counts, heap memory, and OS threads. Clicking the Goroutines timeline reveals how many goroutines were running, runnable, or waiting at a particular moment. The GC, Network, Timers, and Syscalls rows show additional runtime activity that can help explain changes in execution.

Figure: Goroutines STATS breakdown showing runnable and running counts at a selected moment

Look for these patterns:

  • Work concentrated on one P: If most processors are idle while only one goroutine executes at a time, examine whether synchronization is serializing the workload. Use the sync blocking profile to check where goroutines spend time waiting.
  • Goroutines runnable but not executing: A high runnable count alongside long scheduler waits indicates that goroutines are waiting for processor time. Use the scheduler latency profile to identify the affected call stacks.
  • Latency overlapping with garbage collection: Check the GC timeline, mark-assist activity, and stop-the-world events. A mark assist occurs when an application goroutine performs garbage collection work. Overlapping events suggest where to investigate, but they don’t establish that GC caused the latency spike.

Goroutine Analysis

Open Goroutine analysis to examine execution statistics for goroutines grouped by their starting function. Select a group to see its individual goroutines, including how much time each spent executing, waiting for the scheduler, or blocked on other operations. This helps distinguish workers that were actively computing from workers that spent most of their lifetime waiting.

Figure: Goroutine groups including eight workers in main.work.func1

For example, in the mutex-contention program from Step 1, select the group containing main.work.func1 and compare the workers’ execution and waiting times.

Figure: Execution and synchronization waiting times for the eight worker goroutines

Click an individual goroutine to open its timeline. The view focuses on that worker and the goroutines it interacts with through blocking and unblocking events, making it easier to follow how workers compete for the shared lock.

Figure: Single-worker timeline showing related goroutines and a mutex lock stack trace

Pay attention to the Scheduler wait column. A large value means the goroutine was runnable but had not yet been scheduled on a P. If execution time is small but total duration is high, examine its other waiting states and the corresponding blocking profiles before deciding what caused the delay.

Network, Sync, Syscall, and Scheduler Blocking Profiles

The timeline shows when goroutines stop running, but the blocking profiles help identify where the waiting time accumulates. Open a profile from the trace viewer’s index page to examine a call graph of the relevant stacks, or export it for analysis with go tool pprof.

Figure: Trace viewer index links to network, synchronization, syscall, and scheduler profiles

Profile-pprof valueWhat to investigate
Network blockingnetGoroutines waiting for network I/O
Synchronization blockingsyncMutex contention, channel operations, and synchronization waits
Syscall blockingsyscallTime spent blocked in system calls
Scheduler latencyschedRunnable goroutines waiting to execute on a P

These profiles measure accumulated waiting time rather than CPU consumption. Because multiple goroutines can wait simultaneously, the total can exceed the trace’s elapsed time. For example, eight goroutines waiting for one second each contribute eight seconds of accumulated waiting time, even if all eight waits happen during the same second.

Figure: Synchronization blocking profile showing approximately 1,622 ms of accumulated mutex waiting

To investigate the mutex contention from the earlier example, export the synchronization blocking profile:

go tool trace -pprof=sync trace.out > sync.pprof

The -pprof=sync option extracts synchronization waits from the execution trace and writes them to sync.pprof. Open that file with:

go tool pprof sync.pprof

In the interactive pprof shell, run top to rank functions by accumulated blocking time. Look for entries associated with sync.(*Mutex).Lock, then inspect their callers to identify where your application acquires the contended lock. If Graphviz is installed, use web to display the call graph and follow the blocking time back to the relevant application function.

You can repeat the process with net, syscall, or sched when the timeline points to another type of delay. This helps determine which operations account for the recorded waiting time before you change the application.

If you prefer a desktop interface, gotraceui can visualize Go execution traces without a browser. It provides per-goroutine timelines, flame graphs, and histograms for examining execution and waiting time. Check compatibility with the Go version that produced your trace: the tagged v0.4.0 release cannot read the newer trace format introduced in Go 1.22, so newer traces require a compatible build.

Example: Find and Fix a Go Performance Bottleneck

The synchronization profile identifies main.(*cache).update as the source of mutex contention. The function holds the lock while expensive() performs its calculation, preventing other workers from acquiring it. Move the calculation outside the critical section so workers can compute concurrently while keeping writes to the shared map protected.

Replace the existing update() function with:

func (c *cache) update(key int) {
    v := expensive(key)

    c.mu.Lock()
    c.data[key%64] += v
    c.mu.Unlock()
}

The calculation now finishes before the worker acquires c.mu. Only the map update runs inside the critical section, allowing other workers to continue their computations without waiting for the lock.

Before running the corrected program, preserve the original trace for comparison:

mv trace.out trace-before.out

Run the program again and open the new trace:

go run main.go
go tool trace trace.out

The elapsed: output should decrease. For example, repeated runs of this program produced a median execution time of approximately 258.5 ms before the change and 61.6 ms afterward, a reduction of about 76%. Your results will depend on the available CPU resources, so use the trace to confirm that mutex contention has decreased.

Open Goroutine analysis and select main.work.func1. The results should look like the screenshot below, where the eight workers spend most of their time executing, with no synchronization blocking recorded for these workers.

Figure: Worker goroutines spending most of their time executing after the mutex contention fix

The Synchronization blocking profile also changes. Instead of substantial waiting at sync.(*Mutex).Lock, the corrected trace shows approximately 63.54 ms at sync.(*WaitGroup).Wait. This represents the main goroutine waiting for the workers to finish, rather than workers competing for the cache mutex.

Figure: Synchronization blocking profile showing the remaining WaitGroup wait after removing mutex contention

Compare the corrected trace with trace-before.out. A shorter execution time and the disappearance of substantial mutex waiting indicate that narrowing the critical section resolved the bottleneck. If another function now accounts for most of the delay, inspect its call stack before making further changes.

Annotating Traces and Capturing Intermittent Slow Requests

When several requests run concurrently, knowing that a goroutine was blocked doesn’t necessarily tell you which request was affected. You can use tasks and regions to identify the work associated with each goroutine, then capture intermittent slowdowns with Go’s flight recorder.

Add Tasks, Regions, and Logs with runtime/trace

Suppose an order handler loads inventory and processes a payment. You want to know which operation took longer and whether any goroutines were blocked while processing the order.

Use trace.NewTask to group the order’s work under one task, trace.WithRegion to mark individual operations, and trace.Log to record the order ID:

func handleOrder(ctx context.Context, orderID string) {
    ctx, task := trace.NewTask(ctx, "handleOrder")
    defer task.End()

    trace.Log(ctx, "orderID", orderID)

    trace.WithRegion(ctx, "loadInventory", func() {
        loadInventory(ctx, orderID)
    })

    done := make(chan struct{})
    go func() {
        defer close(done)

        trace.WithRegion(ctx, "chargeCard", func() {
            chargeCard(ctx, orderID)
        })
    }()
    <-done
}

Notice that the payment goroutine receives the same ctx. This associates its activity with the handleOrder task even though it runs in a separate goroutine. Each region records the duration of its operation, while task.End() marks when the entire order finishes.

After capturing a trace, open User-defined tasks in go tool trace and select handleOrder. You can compare task durations, inspect a slow order, and follow its regions into the execution timeline. If payment processing took longer than expected, check whether the goroutine was executing, waiting for I/O, or blocked on synchronization.

Keep task and region names consistent across requests. Use names such as handleOrder, loadInventory, and chargeCard, and record variable values such as order IDs with trace.Log. This lets you group similar operations without creating a separate task type for every request.

Capture Slow Requests with the Go Flight Recorder

You can’t always reproduce a slow request while tracing is active. If the problem occurs only occasionally, starting a trace afterward misses the events that caused it.

With Go 1.25 or later, use trace.FlightRecorder to keep recent execution events in memory and save them when a request exceeds your latency threshold. Instead of recording everything to a trace file, you capture the window surrounding the slow request.

For example, you can configure an HTTP server to save a trace when request handling exceeds 100 ms:

package main

import (
    "log"
    "net/http"
    "os"
    "runtime/trace"
    "sync"
    "time"
)

var (
    fr   *trace.FlightRecorder
    once sync.Once
)

func captureSnapshot() {
    once.Do(func() {
        f, err := os.Create("snapshot.trace")
        if err != nil {
            log.Printf("create snapshot: %v", err)
            return
        }
        defer f.Close()

        if _, err := fr.WriteTo(f); err != nil {
            log.Printf("write snapshot: %v", err)
            return
        }

        fr.Stop()
        log.Println("captured snapshot.trace")
    })
}

func handler(w http.ResponseWriter, r *http.Request) {
    start := time.Now()
    doWork()

    if fr.Enabled() && time.Since(start) > 100*time.Millisecond {
        go captureSnapshot()
    }

    w.Write([]byte("ok\n"))
}

func doWork() {
    time.Sleep(150 * time.Millisecond)
}

func main() {
    fr = trace.NewFlightRecorder(trace.FlightRecorderConfig{
        MinAge:   200 * time.Millisecond,
        MaxBytes: 1 << 20,
    })

    if err := fr.Start(); err != nil {
        log.Fatal(err)
    }

    http.HandleFunc("/", handler)
    log.Fatal(http.ListenAndServe(":8080", nil))
}

Save the code as main.go and run it:

go run main.go

In another terminal, send a request:

curl http://localhost:8080/

The doWork() function sleeps for 150 ms, deliberately exceeding the 100 ms threshold. You should receive ok in the terminal and find a new snapshot.trace file in the server’s working directory.

Open it with:

go tool trace snapshot.trace

You can now inspect the scheduling and blocking events recorded around the request rather than trying to reproduce the delay while manually tracing.

Two settings control how much history the recorder retains:

  • MinAge: How long recent events should remain available. The 200 ms setting covers the example request. For a five-second timeout, use approximately ten seconds so the beginning of the operation is more likely to remain in the buffer.
  • MaxBytes: The memory budget hint for buffered trace data. If the buffer reaches this limit, it takes precedence over MinAge, so you may lose older events before the requested window has elapsed. The setting isn’t a strict memory or snapshot-size limit.

The sync.Once call allows only the first slow request to trigger a snapshot. It also prevents overlapping calls to WriteTo(), which aren’t supported. After saving the trace, fr.Stop() ends recording. Remove this one-shot behavior only when you have a way to coordinate subsequent snapshots.

Remember that the snapshot contains activity from the entire Go process, not just the request that crossed the threshold. Add task annotations to your request handlers when you need to distinguish that request from other concurrent work. You can then open its task in the trace viewer and inspect the goroutines and regions associated with the slowdown.

How groundcover Complements Go Execution Tracing

go tool trace helps you identify scheduling delays, mutex contention, and other runtime bottlenecks inside a Go process. When a Go service slows down in Kubernetes, you also need to understand its request latency, downstream dependencies, and infrastructure conditions to determine where the problem originates.

groundcover complements Go execution tracing with eBPF-based application monitoring, Kubernetes telemetry, CPU profiling, and AI-assisted investigations. You can identify affected services, investigate performance problems across your cluster, and measure the effect of code changes on application performance.

Monitor Go Requests Without SDK Instrumentation

Groundcover’s eBPF sensor runs as a Kubernetes DaemonSet and captures supported HTTP, gRPC, and database operations without requiring Go SDKs, application rebuilds, or restarts. When a Go API experiences increased latency, you can examine request durations, error rates, and affected endpoints. The sensor processes observed traffic and selectively retains detailed traces, including latency outliers, errors, and samples of normal requests.

For HTTPS traffic, groundcover supports Go’s crypto/tls through user-space probes, allowing it to inspect supported encrypted requests without a TLS-terminating proxy. You can also combine eBPF collection with OpenTelemetry to capture custom spans for operations such as order validation and business logic, connecting application-level details with request and infrastructure telemetry.

Correlate Go Latency with Kubernetes and CPU Activity

A slow Go request may be waiting for PostgreSQL, Redis, an external API, or another microservice rather than spending time executing application code. Groundcover’s dependency mapping helps you identify these connections and examine operations contributing to request latency. You can also inspect workload metrics, logs, and Kubernetes events to check whether CPU throttling, memory pressure, or pod failures coincide with the slowdown.

For CPU-intensive workloads, groundcover’s opt-in eBPF profiling provides flame graphs showing which functions consume processor time. You can compare profiles across time ranges to identify changes in CPU consumption after a deployment and focus your optimization efforts on the functions responsible.

Investigate Go Performance Regressions with AI

You can use groundcover’s Agent Mode to investigate performance regressions across telemetry sources. For example, ask why a Go checkout service’s latency increased after a deployment. The agent can query request traces, application logs, infrastructure metrics, and Kubernetes events to examine affected operations and potential causes. Its queries and results remain available for you to inspect and validate.

For more complex incidents, groundcover Investigations organizes suspected causes into hypotheses with supporting or refuting evidence. Engineers and AI agents can work on the same investigation, while MCP integration lets connected coding assistants such as Claude Code and Cursor use production telemetry when investigating code regressions.

Verify Go Performance Improvements with groundcover

After identifying and correcting a bottleneck with go tool trace, use groundcover to measure its effect on the running service. Compare request latency, error rates, and throughput before and after deployment, focusing on the same endpoints and workloads. You can also examine CPU profiles and resource metrics to see how the change affects application and infrastructure performance.

For example, after moving the expensive calculation outside the mutex in the earlier Go example, the execution trace confirms that workers spend less time waiting for the lock. In a deployed service, groundcover lets you check whether that improvement also reduces request latency under production traffic. Comparing application metrics alongside the execution traces helps you verify both the runtime fix and its effect on service performance.

FAQs

Open the trace in an up-to-date Chrome or Chromium-based browser. The View trace timeline is designed around Chromium’s tracing viewer and may not render correctly in other browsers. If the page remains blank, press F12 to check the browser console for JavaScript errors, then try a shorter capture. Large trace files can consume substantial browser memory and prevent the timeline from loading.

Execution tracing is generally safe for short production captures, but it adds CPU and memory overhead. On Go 1.21 and later, expect around 1–2% additional CPU usage for many workloads, compared with roughly 10–20% in older versions. Measure the impact on your own service before enabling tracing more broadly.

Keep production captures short, restrict access to /debug/pprof endpoints, and trace only the affected replica when possible. A busy service can generate around 10 MB of trace data per second, making long recordings expensive to analyze. For intermittent slowdowns, use Go 1.25’s flight recorder to retain recent execution events and save a snapshot when the problem occurs.

Sign up for Updates

Keep up with all things cloud-native observability.

We care about data. Check out our privacy policy.