obs/ash: expose workload_type in ASH virtual tables#165866
Merged
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom Mar 17, 2026
Merged
obs/ash: expose workload_type in ASH virtual tables#165866trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Contributor
|
😎 Merged successfully - details. |
Member
The ASH sampler already tracks WorkloadType internally via the WorkloadInfo struct, but this field was not surfaced in the ASHSample struct, the protobuf message, or the virtual tables. Users had no way to distinguish whether a sampled workload was a statement, job, system task, or unknown type. Thread workload_type through all layers: add the field to the Go ASHSample struct, populate it during sampling from WorkloadInfo.WorkloadType.String(), add a proto field (field 9), map it in the status server RPC conversion, and add the column to both crdb_internal.node_active_session_history and crdb_internal.cluster_active_session_history as well as their information_schema views. Empty strings from old nodes during rolling upgrades are guarded to "UNKNOWN" at the virtual table layer. No cluster version gate is needed since this is an additive proto field and virtual table schema change with no persisted state. Release note (sql change): Added a `workload_type` column to the `crdb_internal.node_active_session_history` and `crdb_internal.cluster_active_session_history` virtual tables, as well as the corresponding `information_schema` views. The column exposes the type of workload being sampled, with possible values "STATEMENT", "JOB", "SYSTEM", or "UNKNOWN". Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
5243a0f to
9b9946e
Compare
jasonlmfong
approved these changes
Mar 17, 2026
Collaborator
Author
|
/trunk merge |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose workload_type in the ASH tables and views
Part of: https://cockroachlabs.atlassian.net/browse/CRDB-60684
Release note: None