Is there a way to manually prune logs?
I tried setting the Logs retention period to 1h, but now, 2h later, it still hasn't deleted old records. I managed to mess up a deployment so it spammed and filled db(disk). Still ~100gb left but I want to clear out all logs to start fresh.
n
nitya-signoz
11/27/2024, 3:07 PM
Check the note in this doc, https://signoz.io/docs/userguide/retention-period/ .
The ttl is only applied to new data that will be ingested not the existing data, You can materialized the TTL for old data by going into clickhouse and running
alter table signoz_logs.logs_v2 on cluster cluster materialize ttl
. Do note that it will take up resources if you have a lot of data.
o
Ola Ahlman
11/27/2024, 3:31 PM
ok thanks
Ola Ahlman
11/27/2024, 3:59 PM
@nitya-signoz whats the proper way to enter and execute the command?
I did:
Copy code
# enter container
docker exec -it <container_id> bash
# enter clickhouse
clickhouse
# execute command
alter table signoz_logs.logs_v2 on cluster cluster materialize ttl
but that gives error that there is no cluster. Show databases only list INFORMATION_SCHEMA, default, information_schema, system.
A bit out of my comfort zone navigating around ;)
n
nitya-signoz
11/27/2024, 3:59 PM
use
clickhouse client
instead of
clickhouse
in the second command
o
Ola Ahlman
11/27/2024, 4:00 PM
ok, that returned right away, does it process the request in a background thread?
SigNoz is an open-source APM. It helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc.