Configuring the CLI Activity Tracker

The CLI Activity Tracker monitors running CLI processes in workspace containers and prevents workspace idling while those processes are active. As an administrator, you can enable and configure this feature cluster-wide through the CheCluster custom resource. The operator propagates these settings as environment variables to all workspace containers.

When the CLI Activity Tracker is enabled, it periodically scans for active CLI processes. If it detects a watched process, it resets the workspace idle timer, preventing the workspace from stopping while unattended tasks such as builds, deployments, or long-running scripts are in progress.

All timing fields are optional. When omitted, the CLI Activity Tracker calculates defaults dynamically based on the workspace idle timeout.

Prerequisites
  • An active kubectl session with administrative permissions to the destination Kubernetes cluster. See Overview of kubectl.

Procedure
  1. Enable the CLI Activity Tracker:

    kubectl patch checluster eclipse-che \
      --namespace eclipse-che \
      --type merge \
      --patch '{
        "spec": {
          "devEnvironments": {
            "cliActivityTracker": {
              "enabled": true
            }
          }
        }
      }'
  2. Optional: Configure timing parameters to fine-tune the CLI Activity Tracker behavior:

    kubectl patch checluster eclipse-che \
      --namespace eclipse-che \
      --type merge \
      --patch '{
        "spec": {
          "devEnvironments": {
            "cliActivityTracker": {
              "enabled": true,
              "secondsOfCheckPeriod": <check_period>,
              "secondsOfActivityWindow": <activity_window>,
              "secondsOfGracePeriod": <grace_period>,
              "secondsOfMaxProcessAge": <max_process_age>
            }
          }
        }
      }'
    Table 1. CLI Activity Tracker timing parameters
    Parameter Description

    secondsOfCheckPeriod

    How often (in seconds) to scan for active CLI processes.

    secondsOfActivityWindow

    How long (in seconds) to wait for input from interactive processes before considering them idle.

    secondsOfGracePeriod

    Duration (in seconds) during which newly started processes unconditionally prevent idling.

    secondsOfMaxProcessAge

    Safety limit (in seconds). Processes older than this value stop preventing idling.

  3. To disable the CLI Activity Tracker, remove the cliActivityTracker section or set enabled to false:

    kubectl patch checluster eclipse-che \
      --namespace eclipse-che \
      --type merge \
      --patch '{
        "spec": {
          "devEnvironments": {
            "cliActivityTracker": {
              "enabled": false
            }
          }
        }
      }'