You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
153608: builtins,sql: Add new request_transaction_bundle builtin r=kyle-a-wong a=kyle-a-wong
This new builtin creates a transaction diagnostic request
to capture and generate a transaction bundle for a specified
transaction fingerprint id.
This builting has the following signature:
`crdb_internal.request_transaction_bundle(transaction_fingerprint_id: string, sampling_probability: float, min_execution_latency: interval, expires_after: interval, redacted: bool) -> bool`
transaction_fingerprint_id - a hex-encoded fingerprint id for the transaction
intended to be captured
sampling_probability - the probability used to determine if a transaction bundle
should be recorded. This value must be between [0,1].
min_execution_latency - the minimum execution latency for a transaction. If the
execution time of a transaction is lower than this value,
the request will not be considered fulfilled and will remain
uncompleted. If sampling_probability is non-zero, this value
must also be non-zero.
expires_after - the duration in which a request will remain open. If zero is provided,
the request will exist until it is completed or deleted.
redacted - whether or not the collected bundle will be redacted or unredacted
The builtin will return true if the request is generated successfully, or false
if creating a request for transaction fingerprint id that doesn't exist. Existence
of a transaction fingerprint id is determined by its existence in
`crdb_internal.transaction_statistics`. This is necessary because it is currently
the only system of record for transaction fingerprints in cockroachdb.
The user making the request for a transaction diagnostics bundle must have either
VIEWACTIVITY or VIEWACTIVITYREDACTED grants to call this builtin. If they have
VIEWACTIVITYREDACTED, only redacted bundles can be requested.
Resolves: [CRDB-54322](https://cockroachlabs.atlassian.net/browse/CRDB-54322)
Epic: [CRDB-53541](https://cockroachlabs.atlassian.net/browse/CRDB-53541)
Release note (sql change): adds a new builtin:
`crdb_internal.request_transaction_bundle(transaction_fingerprint_id: string, sampling_probability: float, min_execution_latency: interval, expires_after: interval, redacted: bool) -> bool`
transaction_fingerprint_id - a hex-encoded fingerprint id for the transaction
intended to be captured
sampling_probability - the probability used to determine if a transaction bundle
should be recorded. This value must be between [0,1].
min_execution_latency - the minimum execution latency for a transaction. If the
execution time of a transaction is lower than this value,
the request will not be considered fulfilled and will remain
uncompleted. If sampling_probability is non-zero, this value
must also be non-zero.
expires_after - the duration in which a request will remain open. If zero is provided,
the request will exist until it is completed or deleted.
redacted - whether or not the collected bundle will be redacted or unredacted
The built-in will return true if the request is generated successfully, or false
if creating a request for transaction fingerprint id that doesn't exist.
The user making the request for a transaction diagnostics bundle must have either
VIEWACTIVITY or VIEWACTIVITYREDACTED grants to call this builtin. If they have
VIEWACTIVITYREDACTED, only redacted bundles can be requested.
----
note: This is a stacked PR, only the last commit should be reviewed
Co-authored-by: Kyle Wong <[email protected]>
0 commit comments