Get started (free)

Container environment

All Stackable-managed products regularly log information about their operating environment, such as available disk interfaces and network interfaces.

This logging is performed by our containerdebug tool.

This tool is intended as a debugging aid, and the particular information or format should not be considered stable.

Configuration

By default, containerdebug collects and logs the state of the container every 30 minutes. Following the Stackable roles and role groups concept, you can change the interval or turn containerdebug off with config.containerdebug, either at role or role group level:

spec:
  workers:
    config:
      containerdebug:
        enabled: true # Default
        interval: 1h # Run it every hour in all worker role groups
    roleGroups:
      normal: # Will run every hour, takes configurations above.
        replicas: 1
      quiet: # Disabled containerdebug
        replicas: 1
        config:
          containerdebug:
            enabled: false # Disabled for this role group
enabled

Whether the tool runs in the background of the product container. Defaults to true.

interval

The time between two runs, for example 30m, 1h or 2d. Defaults to 30m and must not be zero.

When containerdebug is turned off, it writes none of the output described below, and its interval is not validated. Product specific configurations, are documented in the corresponding operators logging documentation.

Output

containerdebug writes its output to three places: the console logs, a rotating log file for the log aggregation, and a state file with the result of the latest run.

Console logs

The collected information is printed to STDOUT, so it is readable via kubectl logs <pod>. Like the file logs below, these messages are independent of the log configuration of the product container.

Aggregated log files

The information is also written to the shared Stackable log dir, so that the Vector log agent collects it and forwards it to the Vector aggregator. The operators enable these file logs by setting the environment variable FILE_LOG_DIRECTORY to /stackable/log/containerdebug in the product container. They configure the rotation with FILE_LOG_ROTATION_PERIOD set to hourly, because rotation is off by default, and with FILE_LOG_MAX_FILES set to 2, so that the files do not fill up the log volume, whose size is capped. The resulting files are named containerdebug.<date>.tracing-rs.json.

In the aggregated logs, these events carry the container name containerdebug. No Kubernetes container of that name exists, because containerdebug runs in the background of the product container. The name is derived by the Vector agent from the directory which the files lie in.

If you override FILE_LOG_DIRECTORY, then the directory has to stay exactly one level below /stackable/log, because the Vector agent takes the container name from that path segment. Each container logs into a directory of its own name, so pointing FILE_LOG_DIRECTORY at one of those, such as /stackable/log/<product>, labels the containerdebug events with that container name and mixes them into its logs. Any other path stops the collection of these files, and a path outside /stackable/log additionally leaves the volume whose size is capped.

The log level of these files is independent of the log configuration of the product container. It defaults to INFO and can be changed with the environment variable FILE_LOG_LEVEL.

State file

The collected information is additionally written as JSON to /stackable/log/containerdebug-state.json. This file only contains the output from the latest containerdebug run.