ContainerStats Pipeline

The ContainerStats pipeline builds statistical representations of individual containers' resource usage over time. The pipeline is part of the cost-model container.

Helm configuration

kubecostModel:
  containerStatsEnabled: true

Ensure you allow ~2hrs for the pipeline to run before issuing a query which leverages this pipeline

Behavior

The pipeline builds 24 hour "windows" of data. It only builds complete windows, e.g. if now is 2003-08-23T08:30:00Z, the pipeline will only build up to the window from 2003-08-22T00:00:00Z to 2003-08-23T00:00:00Z.

The pipeline will return an error response if a requested time range of data contains any windows (24 hour chunks) are expected (should be in the store) but not available (the pipeline has not yet built and loaded a complete set of data into the store).

Usage in Kubecost APIs

Request right-sizing recommendation (v2)

The primary user of ContainerStats pipeline data is v2 of the request right- sizing recommendation API. ContainerStats data is used for quantile-based recommendations. Review the doc for this feature here.

Debugging

There is an API for introspecting pipeline data available at /model/containerstats/quantiles. It does not have a stable schema and is not supported as an official product feature. It is only intended for limited debugging.

Logs

All ContainerStats-related log messages should contain ContainerStats or ContainerStatsSet. The pipeline logs a few things at INFO level to show that the pipeline is running successfully. Much greater detail is available at the DEBUG level. See the official instructions to learn how to change the log level.

Configuration

The ContainerStats pipeline's behavior is controller by a few different environment variables.

Last updated