forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
telemetry: track telemetry transactions through conn executor
This change modifies the telemetry transaction sampling process to be simpler. Previously for telemetry transaction sampling the telemetry logging struct managed the tracking of sampled transactions via a map of execution ids. If a transaction was determined to be sampled, we would input an entry in this map and for each statement, we would check the map to see if the statement belongs to a tracked transaction. Instead of using a map, we can mark the transaction as being sampled by telemetry in the conn executor. This removes the need for concurrent data struct access when the transaction is marked as being sampled, since each statement no longer needs to read an entry from the shared map. This also removes the need to track the number of transactions currently being sampled for telemetry, as this was introduced to manage the memory used by the map. We will now determine if the transaction should be logged to telemetry at the start of transaction execution or at the start of a transaction restart. The transaction will be marked for telemetry logging if enough time has elapsed since the last transaction was sampled or if session tracing is on. Transaction statements will be logged according to the following settings: - sql.telemetry.transaction_sampling.frequency controls the frequency at which we sample a transaction. If a transaction is marked to be sampled by telemetry, this means we will log all of its statement execution events to telemetry, up to a maximum of `sql.telemetry.transaction_sampling.statement_events_per_transaction.max` statements. Part of: cockroachdb#108284 Release note (ops change): New cluster settings: - sql.telemetry.transaction_sampling.statement_events_per_transaction.max: controls the maximum number of statement events to emit per sampled transaction for TELEMETRY - sql.telemetry.transaction_sampling.frequency: controls the maximum frequency at which we sample transactions for telemetry
- Loading branch information
Showing
7 changed files
with
665 additions
and
566 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.