Is there a way to manually prune logs? I tried set...
# general
o
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
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
ok thanks
@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
use
clickhouse client
instead of
clickhouse
in the second command
o
ok, that returned right away, does it process the request in a background thread?
n
yes you can check that by
select * from system.mutations where is_done=0