Skip to content

Commit c6794f4

Browse files
authored
DOC-14292 Product Change- PR #149705 - release-25.3: tracing: add background execution tracer (+ debug zip export) (#19935)
* Added automatic-go-execution-tracer.md. * In troubleshooting.json, troubleshooting-overview.md and automatic-cpu-profiler.md, added link to new page. * Incorporated Kevin and Rich’s feedback. * Incorporated David’s clarification.
1 parent 49847cf commit c6794f4

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

src/current/_includes/v25.3/sidebar-data/troubleshooting.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@
112112
"urls": [
113113
"/${VERSION}/automatic-cpu-profiler.html"
114114
]
115+
},
116+
{
117+
"title": "Automatic Go Execution Tracer",
118+
"urls": [
119+
"/${VERSION}/automatic-go-execution-tracer.html"
120+
]
115121
}
116122
]
117123
}

src/current/v25.3/automatic-cpu-profiler.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ Enabling the automatic CPU profile capture on a cluster will add overhead to the
4545
- [P99 latency]({% link {{ page.version.version }}/ui-sql-dashboard.md %}#service-latency-sql-99th-percentile)
4646
- P50 latency by creating a [custom chart]({% link {{ page.version.version }}/ui-custom-chart-debug-page.md %}) for the `sql.exec.latency-p50` metric
4747
- [CPU usage]({% link {{ page.version.version }}/ui-hardware-dashboard.md %}#cpu-percent)
48+
49+
## See also
50+
51+
- [Automatic Go Execution Tracer]({% link {{ page.version.version }}/automatic-go-execution-tracer.md %})
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Automatic Go Execution Tracer
3+
summary: The automatic Go execution tracer can be used to gain fine-grained insight into goroutine scheduling, blocking events, garbage collection, and runtime activity.
4+
keywords: go execution trace, go execution tracing, execution tracer, automatic execution tracer
5+
toc: true
6+
---
7+
8+
The automatic Go execution tracer allows operators and support engineers to investigate internal system behavior over time. Use this feature to gain fine-grained insight into goroutine scheduling, blocking events, garbage collection, and runtime activity.
9+
10+
{{site.data.alerts.callout_info}}
11+
Execution tracing introduces a performance overhead. This feature is primarily intended for use under the guidance of [Cockroach Labs Support](https://support.cockroachlabs.com/).
12+
{{site.data.alerts.end}}
13+
14+
When enabled, the automatic Go execution tracer captures runtime execution traces on a recurring schedule and stores them in the node's log directory. These traces are collected in the background and can be analyzed using Go’s standard tooling (e.g., [`go tool trace`](https://pkg.go.dev/runtime/trace)).
15+
16+
To prevent disk overuse, older traces are automatically garbage collected based on a configurable storage limit.
17+
18+
## Configuration
19+
20+
You can configure automatic Go execution trace capture with the following [cluster settings]({% link {{ page.version.version }}/cluster-settings.md %}):
21+
22+
Cluster Setting | Description | Default Value
23+
----------------|-------------|---------------
24+
`obs.execution_tracer.interval` | Enables periodic execution tracing on each node and defines how often traces are collected. Set to a positive duration (e.g., `10m`, `1h`) to enable. Set to `0` to disable (default). | `0`
25+
`obs.execution_tracer.duration` | Sets how long each execution trace runs. Use short durations (e.g., 5-15 seconds) to produce traces that are easier to analyze. | `10s`
26+
`obs.execution_tracer.total_dump_size_limit` | Sets a soft limit on the total disk space used by execution trace files. When the limit is exceeded, the oldest files are deleted. | `4GiB`
27+
28+
## Accessing Go execution traces
29+
30+
- The automatic Go execution tracer saves the captured traces to disk on each node's file system in the [logging directory]({% link {{ page.version.version }}/configure-logs.md %}#logging-directory). The default path is `cockroach-data/logs/executiontrace_dump`.
31+
- To access these Go execution traces, you must use the node file system.
32+
- Each file represents a single trace session, includes the `executiontrace.` prefix and `.out` extension, and is timestamped with the session end time to support correlation with other logs and profiles. For example, the trace file could be named `executiontrace.2025-07-14T18_41_22.216.out`.
33+
- Enabling the automatic Go execution tracer does add Go execution traces to [debug zips]({% link {{ page.version.version }}/cockroach-debug-zip.md %}) in the `nodes/*/executiontrace` paths.
34+
35+
## Best Practices
36+
37+
- Trace duration should be short (e.g., 5s–15s). Shorter trace files are easier to parse and load into external tools.
38+
- Storage limit should be generous to allow sufficient trace history. Avoid overly tight disk caps unless necessary.
39+
- Enable tracing temporarily when troubleshooting runtime behavior or under [support guidance](https://support.cockroachlabs.com), as it may slightly impact performance.
40+
41+
## Performance Impact
42+
43+
Enabling execution tracing incurs a low overhead, estimated at 1–2% based on upstream Go benchmarks ([Go blog, 2024](https://go.dev/blog/execution-traces-2024#low-overhead-tracing)). No additional CockroachDB-specific benchmarks are available at this time.
44+
45+
## Example
46+
47+
To enable 10-second traces every 15 minutes with a storage limit of `8GiB`, configure the following settings:
48+
49+
```sql
50+
SET CLUSTER SETTING obs.execution_tracer.interval = '15m';
51+
SET CLUSTER SETTING obs.execution_tracer.duration = '10s';
52+
SET CLUSTER SETTING obs.execution_tracer.total_dump_size_limit = '8GiB';
53+
```
54+
55+
## See also
56+
57+
- [Automatic CPU Profiler]({% link {{ page.version.version }}/automatic-cpu-profiler.md %})

src/current/v25.3/troubleshooting-overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ If you experience an issue when using CockroachDB, try these steps to resolve th
3333
- [`cockroach debug zip`]({% link {{ page.version.version }}/cockroach-debug-zip.md %})
3434
- [`cockroach debug tsdump`]({% link {{ page.version.version }}/cockroach-debug-tsdump.md %})
3535
- [Automatic CPU Profiler]({% link {{ page.version.version }}/automatic-cpu-profiler.md %})
36+
- [Automatic Go Execution Tracer]({% link {{ page.version.version }}/automatic-go-execution-tracer.md %})

0 commit comments

Comments
 (0)