How can i clean logs / traces history in signoz ?
# support
c
How can i clean logs / traces history in signoz ?
v
Hey @C H you can update retention period in settings: https://signoz.io/docs/userguide/retention-period/
c
yes already done that
but my clickhouse dir is huge 24G ./clickhouse
with history set to one day and very very few traffic
v
After setting retention period the old data clean up happens slowly. Can you check if you can see old data by sorting trace table by timestamp in descending order?
c
no after cleanup i cannot see old traces / logs
but store dir is always huge 24G ./clickhouse/store
maybe an upgrade or a bad migration between signoz version or a bug ?
v
What’s total number of traces? Check on trace page by setting datetime to last 7 days/ 1 week
c
65k traces
v
Which version are you running? and did you upgrade to any new version?
Can you also if check logs are being stored?
c
yes but i set logs retention period to 1 day
Copy code
24G     ./clickhouse/store
4.0K    ./clickhouse/metadata_dropped
76K     ./clickhouse/preprocessed_configs
4.0K    ./clickhouse/user_defined
33M     ./clickhouse/rocksdb
4.0K    ./clickhouse/metadata/information_schema
4.0K    ./clickhouse/metadata/INFORMATION_SCHEMA
60K     ./clickhouse/metadata
24K     ./clickhouse/access
4.0K    ./clickhouse/tmp
4.0K    ./clickhouse/user_scripts
16K     ./clickhouse/data/default
20K     ./clickhouse/data/signoz_metrics
36K     ./clickhouse/data/system
20K     ./clickhouse/data/signoz_logs
36K     ./clickhouse/data/signoz_traces
132K    ./clickhouse/data
24G     ./clickhouse
v
Which version are you running? and did you upgrade to latest version recently?
c
yes : v0.11.0
what is a best way to reset alll, i can loose my traces / logs / history
v
If you want to reset signoz completely then you need to first uninstall signoz and then delete signoz folder. This will delete all the data, You can do a fresh install now.
c
ok but i don't want to loose my configs dashboard & co 🙂 Is there a way to reset only clickhouse bad datas ?
Copy code
if i remove dir like : ./clickhouse/store/894/894eef96-289d-42d1-945e-1192b1a9d54f/202208_620497_676942_1793
v
Yes, you can safely remove
./clickhouse/store
Dashboards and configs are stored in sqlite db so they won’t be deleted.
c
Thks, i'm gonna try that.
ok, i removed store dir & uninstall / reinstall signoz 🙂
p
@C H You can make use Make commands below to remove all persisted data: ClickHouse (traces, metrics, and logs data) and SQLite (dashboard, alerts, users, and org data). At first bring down SigNoz cluster, run the following commands and bring it back up. For Standalone:
Copy code
make clear-standalone-data
For Swarm:
Copy code
make clear-swarm-data
c
ok thks 🙂
270 Views