Skip to content

Commit 9d04d2f

Browse files
Merge branch 'main' into 20251023-doc-14222-extra-headers
2 parents b5d1b1c + afcb8fe commit 9d04d2f

File tree

7 files changed

+34
-3
lines changed

7 files changed

+34
-3
lines changed

src/current/_includes/v24.1/ui/transaction-details.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The details displayed on the **Transaction Details** page reflect the [time inte
66
- The **Mean transaction time**: The mean average time it took to execute the transaction within the aggregation interval.
77
- The **Application name**: The name specified by the [`application_name`]({{ link_prefix }}show-vars.html#supported-variables) session setting.
88
- **Transaction resource usage** shows overall statistics about the transaction.
9+
- **Idle latency**: The time the transaction spent waiting on the client while the transaction remained open.
910
- **Mean rows/bytes read**: The mean average number of rows and bytes [read from the storage layer]({{ link_prefix }}architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) during the execution of the transaction within the specified aggregation interval.
1011
- **Bytes read over network**: The amount of [data transferred over the network]({{ link_prefix }}architecture/reads-and-writes-overview.html) for this transaction within the aggregation interval. <br><br>If this value is 0, the statement was executed on a single node.
1112
- **Mean rows written**: The mean number of rows written by this transaction.

src/current/_includes/v24.3/ui/transaction-details.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The details displayed on the **Transaction Details** page reflect the [time inte
66
- The **Mean transaction time**: The mean average time it took to execute the transaction within the aggregation interval.
77
- The **Application name**: The name specified by the [`application_name`]({{ link_prefix }}show-vars.html#supported-variables) session setting.
88
- **Transaction resource usage** shows overall statistics about the transaction.
9+
- **Idle latency**: The time the transaction spent waiting on the client while the transaction remained open.
910
- **Mean rows/bytes read**: The mean average number of rows and bytes [read from the storage layer]({{ link_prefix }}architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) during the execution of the transaction within the specified aggregation interval.
1011
- **Bytes read over network**: The amount of [data transferred over the network]({{ link_prefix }}architecture/reads-and-writes-overview.html) for this transaction within the aggregation interval. <br><br>If this value is 0, the statement was executed on a single node.
1112
- **Mean rows written**: The mean number of rows written by this transaction.

src/current/_includes/v25.2/ui/transaction-details.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The details displayed on the **Transaction Details** page reflect the [time inte
66
- The **Mean transaction time**: The mean average time it took to execute the transaction within the aggregation interval.
77
- The **Application name**: The name specified by the [`application_name`]({{ link_prefix }}show-vars.html#supported-variables) session setting.
88
- **Transaction resource usage** shows overall statistics about the transaction.
9+
- **Idle latency**: The time the transaction spent waiting on the client while the transaction remained open.
10+
- **Commit latency**: The time required to finish committing the transaction after the commit phase began.
911
- **Mean rows/bytes read**: The mean average number of rows and bytes [read from the storage layer]({{ link_prefix }}architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) during the execution of the transaction within the specified aggregation interval.
1012
- **Bytes read over network**: The amount of [data transferred over the network]({{ link_prefix }}architecture/reads-and-writes-overview.html) for this transaction within the aggregation interval. <br><br>If this value is 0, the statement was executed on a single node.
1113
- **Mean rows written**: The mean number of rows written by this transaction.

src/current/_includes/v25.3/ui/transaction-details.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The details displayed on the **Transaction Details** page reflect the [time inte
66
- The **Mean transaction time**: The mean average time it took to execute the transaction within the aggregation interval.
77
- The **Application name**: The name specified by the [`application_name`]({{ link_prefix }}show-vars.html#supported-variables) session setting.
88
- **Transaction resource usage** shows overall statistics about the transaction.
9+
- **Idle latency**: The time the transaction spent waiting on the client while the transaction remained open.
10+
- **Commit latency**: The time required to finish committing the transaction after the commit phase began.
911
- **Mean rows/bytes read**: The mean average number of rows and bytes [read from the storage layer]({{ link_prefix }}architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) during the execution of the transaction within the specified aggregation interval.
1012
- **Bytes read over network**: The amount of [data transferred over the network]({{ link_prefix }}architecture/reads-and-writes-overview.html) for this transaction within the aggregation interval. <br><br>If this value is 0, the statement was executed on a single node.
1113
- **Mean rows written**: The mean number of rows written by this transaction.

src/current/_includes/v25.4/ui/transaction-details.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The details displayed on the **Transaction Details** page reflect the [time inte
66
- The **Mean transaction time**: The mean average time it took to execute the transaction within the aggregation interval.
77
- The **Application name**: The name specified by the [`application_name`]({{ link_prefix }}show-vars.html#supported-variables) session setting.
88
- **Transaction resource usage** shows overall statistics about the transaction.
9+
- **Idle latency**: The time the transaction spent waiting on the client while the transaction remained open.
10+
- **Commit latency**: The time required to finish committing the transaction after the commit phase began.
911
- **Mean rows/bytes read**: The mean average number of rows and bytes [read from the storage layer]({{ link_prefix }}architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) during the execution of the transaction within the specified aggregation interval.
1012
- **Bytes read over network**: The amount of [data transferred over the network]({{ link_prefix }}architecture/reads-and-writes-overview.html) for this transaction within the aggregation interval. <br><br>If this value is 0, the statement was executed on a single node.
1113
- **Mean rows written**: The mean number of rows written by this transaction.

src/current/v25.4/crdb-internal.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,8 @@ Contention events are stored in memory. You can control the amount of contention
11881188

11891189
The `sql.contention.event_store.duration_threshold` [cluster setting]({% link {{ page.version.version }}/cluster-settings.md %}) specifies the minimum contention duration to cause the contention events to be collected into the `crdb_internal.transaction_contention_events` table. The default value is `0`. If contention event collection is overwhelming the CPU or memory you can raise this value to reduce the load.
11901190

1191+
You can also [monitor transaction contention using logs]({% link {{ page.version.version }}/monitor-and-analyze-transaction-contention.md %}#monitor-using-logs) for a durable history of contention.
1192+
11911193
{% include {{ page.version.version }}/transaction-contention-events-columns.md %}
11921194

11931195
#### Transaction contention - example

src/current/v25.4/monitor-and-analyze-transaction-contention.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This page shows how to monitor and analyze two types of [contention]({% link {{
1010

1111
- [Console](#monitor-using-console)
1212
- [Metrics](#monitor-using-metrics)
13+
- [Logs](#monitor-using-logs)
1314
- [`crdb_internal` tables](#monitor-using-crdb_internal-tables)
1415

1516
The [Continuous monitoring](#continuous-monitoring) section provides further considerations on identifying when contention occurs in your workload.
@@ -113,6 +114,26 @@ CockroachDB Metric Name | Description | Type | Unit
113114

114115
Correlate these metrics with information from the [Insights]({% link {{ page.version.version }}/ui-insights-page.md %}) and [SQL Activity]({% link {{ page.version.version }}/ui-overview.md %}#sql-activity) pages to identify the affected database.
115116

117+
## Monitor using logs
118+
119+
CockroachDB periodically summarizes resolved contention activity as structured log events on the [`SQL_EXEC` logging channel]({% link {{ page.version.version }}/logging-overview.md %}#logging-channels). Each `aggregated_contention_info` [event]({% link {{ page.version.version }}/eventlog.md %}) reports:
120+
121+
- the waiting statement and transaction fingerprints
122+
- the blocking transaction fingerprint
123+
- the contended key (if not redacted)
124+
- the total wait time for that combination since the previous event
125+
126+
[Configure log sinks]({% link {{ page.version.version }}/configure-logs.md %}#configure-log-sinks) to route the `SQL_EXEC` channel to a destination, such as a log file or external collector, for long-term analysis.
127+
128+
These periodic reports complement the in-memory [`crdb_internal.transaction_contention_events`](#transaction_contention_events-table) table by providing a durable view of contention history that persists across [node restarts]({% link {{ page.version.version }}/node-shutdown.md %}) or after contention data expires from the event store. Reports are generated at an interval defined by the cluster setting [`sql.contention.event_store.resolution_interval`](#sql-contention-event_store-resolution_interval).
129+
130+
The structured payload makes it easy to ingest the events into log analytics tools and correlate them with statement fingerprints or [key hotspots]({% link {{ page.version.version }}/understand-hotspots.md %}#row-hotspot). A typical structured log entry looks like the following:
131+
132+
{% include_cached copy-clipboard.html %}
133+
~~~ json
134+
{"Timestamp":1756224167482848000,"EventType":"aggregated_contention_info","WaitingStmtFingerprintId":"\\x000000000000007b","WaitingTxnFingerprintId":"\\x00000000000001c8","BlockingTxnFingerprintId":"\\x0000000000000315","ContendedKey":"‹/Table/106/1/8/0›","Duration":300000000}
135+
~~~
136+
116137
## Monitor using `crdb_internal` tables
117138

118139
The [`crdb_internal`]({% link {{ page.version.version }}/crdb-internal.md %}) system catalog is a schema that contains information about internal objects, processes, and metrics related to a specific database. `crdb_internal` tables are read-only.
@@ -131,11 +152,11 @@ Setting | Type | Default | Description
131152
--------|------|---------|-------------
132153
`sql.contention.event_store.capacity` | byte size | `64 MiB` | the in-memory storage capacity per-node of contention event store
133154
`sql.contention.event_store.duration_threshold` | duration | `0s` | minimum contention duration to cause the contention events to be collected into crdb_internal.transaction_contention_events. If `0`, always store.
134-
`sql.contention.event_store.resolution_interval ` | duration | `30s ` | the interval at which transaction fingerprint ID resolution is performed (set to 0 to disable)
155+
<a id="sql-contention-event_store-resolution_interval"></a>`sql.contention.event_store.resolution_interval ` | duration | `30s ` | the interval at which transaction fingerprint ID resolution is performed (set to 0 to disable)
135156
`sql.contention.record_serialization_conflicts.enabled` | boolean | `true` | enables recording 40001 errors with conflicting txn meta as SERIALIZATION_CONFLICT contention events into crdb_internal.transaction_contention_events
136157

137158
{{site.data.alerts.callout_info}}
138-
`crdb_internal.transaction_content_events` displays in-memory data, not on-disk data. The data changes over time as new events arrive and old ones are evicted from the cache.
159+
`crdb_internal.transaction_contention_events` displays in-memory data, not on-disk data. The data changes over time as new events arrive and old ones are evicted from the cache.
139160
{{site.data.alerts.end}}
140161

141162
The table columns are as follows:
@@ -587,4 +608,4 @@ While the previous analysis process uses the `crdb_internal` tables, the perform
587608
- Statements page ([CockroachDB Cloud Console]({% link cockroachcloud/statements-page.md %}) or [DB Console]({% link {{ page.version.version }}/ui-statements-page.md %}))
588609
- Transactions page ([CockroachDB Cloud Console]({% link cockroachcloud/transactions-page.md %}) or [DB Console]({% link {{ page.version.version }}/ui-transactions-page.md %}))
589610
- Insights page ([CockroachDB Cloud Console]({% link cockroachcloud/insights-page.md %}) or [DB Console]({% link {{ page.version.version }}/ui-insights-page.md %}))
590-
- [`crdb_internal`]({% link {{ page.version.version }}/crdb-internal.md %})
611+
- [`crdb_internal`]({% link {{ page.version.version }}/crdb-internal.md %})

0 commit comments

Comments
 (0)