please help me on log management , within a week i...
# support
s
please help me on log management , within a week it getting bigger 21gb , i dont know how to handle and rotate this
s
This is not a log file to rotate. It is a database of data files that store the telemetry data.
s
how to manage this as server side space is getting increase due to this
a
You can add data retention policy.
s
any example to do this ?
a
image.png
s
ok so i have to add retention for metrics as srikanth says its db data file , correct me if i am wrong
i have added retention policy as a test i edit to 1hrs but this setting not delete the old data and my disk is keep getting expend , any solution ?
s
It doesn't delete the old data right away. When the existing TTL applied expire then old data get removed.
s
as per my previous reply i add time 1hr but still it generate lots of data so how i can insure it get deleted , 1hrs is added on wed and today is friday more then 48hrs and it now reach 58gb, i need help in this
s
Stop sending every message in the thread to the whole channel. What are you trying to achieve by sending every message to the whole channel?
s
ok i untick it , should i delete the data manually as this was not deleted automatic
s
Yes, please run this query to find which table is taking space and truncate https://clickhouse.com/docs/en/sql-reference/statements/truncate
Copy code
SELECT
    database,
    table,
    formatReadableSize(sum(data_compressed_bytes) AS size) AS compressed,
    formatReadableSize(sum(data_uncompressed_bytes) AS usize) AS uncompressed,
    round(usize / size, 2) AS compr_rate,
    sum(rows) AS rows,
    count() AS part_count
FROM system.parts
WHERE (active = 1) AND (database LIKE '%') AND (table LIKE '%')
GROUP BY
    database,
    table
ORDER BY size DESC;
s
thanks for this command , finally i use to empty the tables via docker exec fc8239cb7574 clickhouse client --query="TRUNCATE TABLE signoz_traces.signoz_index_v2" -- now 15 gb is used and rest is free
i also remove my whole channel message