-
Notifications
You must be signed in to change notification settings - Fork 4k
builtins,sql: Add new request_transaction_bundle builtin #153608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
bc6d614
to
249a10c
Compare
e876738
to
eca2303
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spelling in commit message: This builting has the following signature:
eca2303
to
44be820
Compare
This new builtin creates a transaction diagnostic request to capture and generate a transaction bundle for a specified transaction fingerprint id. This builtin 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) -> (int as request_id, bool as created) ``` 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 request_id, true if the request is generated successfully, or null, 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 Epic: 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) -> (int as request_id, bool as created) ``` 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 request_id, true if the request is generated successfully, or null, 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.
44be820
to
1f08c98
Compare
bors r+ |
Build succeeded: |
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 currentlythe 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
Epic: 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