How to Set the Retention Time of Cold Data for a Project
Use project labels to override the platform-default retention for logs that belong to a specific project.
Project overrides currently apply to the ClickHouse storage backend with hot / cold tiering enabled. Behavior on OpenSearch is limited (see the note at the end).
TOC
Before You BeginAbout Project-Level Retention SettingsEdit the Project ResourceLabel BehaviorVersion NotesRelated TopicsBefore You Begin
Confirm the target storage cluster:
- Uses Alauda Container Platform Log Storage Management with
PlatformLogForward.spec.externalStorage.type: clickhouse. - Has hot / cold tiering enabled on
PlatformLogForward; see How to Use S3 Storage with ClickHouse. - Is queried by the account you plan to use to edit the target project on the
globalcluster.
About Project-Level Retention Settings
Project labels override the PLF-level ttl (hot) and coldTTL (cold) values for records tagged with that project's name.
Use the following labels on the Project resource:
Legacy labels still exist in some environments (cpaas.io/project.esIndicesKeepDays, cpaas.io/project.esPolicyEnabled), but new configurations should use the labels above.
Edit the Project Resource
-
Log in to the
globalcluster. -
Open the target project resource:
-
Add or update the following labels:
The change reaches the storage cluster within a minute through the platform's cross-cluster policy sync.
Label Behavior
cpaas.io/project.hotDataRetentionDaysControls how long the project's hot data remains in active ClickHouse storage before it is moved (with tiering enabled) or deleted (with tiering disabled).cpaas.io/project.coldDataRetentionDaysControls how long the project's cold data is retained after it has been transferred to S3.cpaas.io/project.logPolicyEnabledMust be set totruefor the project-level retention policy to take effect.
Version Notes
- ACP 4.2 environments may have old and new labels coexisting for compatibility.
- ACP 4.3 and later, including ACP 4.4, use the new labels as the source of truth.
- If your environment still contains legacy labels such as
cpaas.io/project.esIndicesKeepDaysorcpaas.io/project.esPolicyEnabled, prefer the new labels for new configurations.
On the OpenSearch storage backend the project-scoped labels above do not currently take effect. The operator skips writing log-policy-config on the OS backend, and the razor-api cron that reconciles the ISM policy only reads the policy, never writes it. As a result:
cpaas.io/project.hotDataRetentionDays— no effect.cpaas.io/project.coldDataRetentionDays— no effect (OpenSearch tiered storage is provisioned outside the platform anyway).cpaas.io/project.logPolicyEnabled— no effect.
Every project on an OpenSearch storage cluster keeps the platform-default retention. If per-project retention is a compliance requirement, choose the ClickHouse backend, or apply your own ISM policies directly against the OpenSearch cluster.
See Log Component Selection Guide — Known OpenSearch backend limitations for the full list of OS-specific caveats.
Related Topics
- How to Use S3 Storage with ClickHouse — plugin-side cold storage configuration.
- Installation — the PLF creation flow.