Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 968ce2c

Browse files
committed
Document data retention configuration
1 parent b23f65c commit 968ce2c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@ By default, the `timescale-observability` Helm chart sets up a single-instance o
4141
interested in a replicated setup for high-availabilty with automated backups, please see
4242
[this github repo](https://github.com/timescale/timescaledb-kubernetes/tree/master/charts/timescaledb-single) for additional instructions.
4343

44+
# Configuring data retention
45+
46+
By default, data is stored for 90 days and then deleted.
47+
This default can be changed in SQL by using the SQL function
48+
`set_default_retention_period(new interval)`. For example,
49+
```
50+
SELECT set_default_retention_period(180 * INTERVAL '1 day')
51+
```
52+
53+
You can also override this default on a per-metric basis using
54+
the SQL function `set_metric_retention_period(metric_name, interval)`
55+
and undo this override with `reset_metric_retention_period(metric_name)`.
56+
57+
Note: The default applies to all metrics that do not have override,
58+
no matter whether they were created before or after the call to
59+
`set_default_retention_period`.
60+
4461
# Working with SQL data
4562

4663
We describe how to use our pre-defined views and functions to work with the prometheus data in [the SQL schema doc](docs/sql_schema.md).
@@ -57,6 +74,11 @@ This is used as a dependency from the `timescale-observability` Helm chart and c
5774

5875
## Non-Helm installation methods
5976

77+
Any non-helm installations also need to make sure the `drop_chunks` procedure on a regular
78+
basis (e.g. via CRON). We recommend executing it every 30 minutes.
79+
This is necessary to execute data retention policies according to the configured policy.
80+
This is set up automatically in helm.
81+
6082
### Binaries
6183

6284
You can download pre-built binaries for the Timescale-Prometheus Connector [on our release page](https://github.com/timescale/timescale-prometheus/releases).

0 commit comments

Comments
 (0)