Skip to content

Provide a historical view of all sessions including session statistics in the DB console and SQL CLI #67888

@kevin-v-ngo

Description

@kevin-v-ngo

We should provide a historical view of Sessions as we have with Transactions and Statements. This issue tracks the V1 experience of persisting "Closed" Sessions for a period of time. V2 builds on top of this by adding additional session details and statistics.

Adding historical sessions including additional information would provide a higher-level grouping of customer workloads at the session-level. CockroachDB workloads typically issue single statement transactions (implicit) and allowing a grouping at the session level will allow users to:

  • Verify customer application logic is correct by being able to review the transactions/statements that were issued in a particular session
  • Identify and troubleshoot specific sessions at a particular time that issued transactions/statements with slow (or failed) executions.
  • Identify and troubleshoot specific sessions that consumed a relatively large amount of ‘time’ from the database.

For this issue, crdb_internal.cluster_session and the existing console information is captured and surfaced for closed sessions. New information to add includes the "Closed" status and End time.

Given the potential size of data there are a few options we can explore in terms of the retention period:

  1. N hour retention period in memory
  2. Max #rows for this crdb_internal table where oldest entries would then be purged (can be applied in conjunction with 1)
  3. Like statement and transaction persisted statistics, we keep a subset of the data in memory and flush it to disc at various intervals.

Link to the current Figma

Epic: CRDB-9087

Jira issue: CRDB-8763

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-cli-observabilityIssues related to surfacing SQL observability in SHOW, CRDB_INTERNAL, SYSTEM, etc.A-sql-console-generalSQL Observability issues on the DB console spanning multiple areas. Includes Cockroach Cloud ConsoleC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions