Skip to content

Commit

Permalink
add reset signoz script
Browse files Browse the repository at this point in the history
  • Loading branch information
yashgorana committed Sep 19, 2024
1 parent ea7e123 commit ee3991b
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,34 @@ start-signoz: && (apply-signoz _ctx_signoz) (setup-signoz _ctx_signoz)
Dashboard: \033[1;36mhttp://localhost:{{ port_signoz_ui }}\033[0m\n\
OTEL Endpoint: \033[1;36mhttp://localhost:{{ port_signoz_otel }}\033[0m\n"

# K9s into the Signoz cluster
# Remove SigNoz from the cluster
[group('signoz')]
k9s-signoz:
k9s --context {{ _ctx_signoz }}
delete-signoz: (delete-cluster _name_signoz)

# Remove SigNoz from the cluster
# Remove all SigNoz data without deleting
[group('signoz')]
delete-collector:
helm uninstall k8s-infra
reset-signoz:
@kubectl exec --context {{ _ctx_signoz }} -n platform chi-signoz-clickhouse-cluster-0-0-0 --container clickhouse -- \
clickhouse-client --multiline --multiquery "\
TRUNCATE TABLE signoz_analytics.rule_state_history_v0; \
TRUNCATE TABLE signoz_logs.logs_v2; \
TRUNCATE TABLE signoz_logs.logs; \
TRUNCATE TABLE signoz_logs.usage; \
TRUNCATE TABLE signoz_metrics.usage; \
TRUNCATE TABLE signoz_traces.durationSort; \
TRUNCATE TABLE signoz_traces.signoz_error_index_v2; \
TRUNCATE TABLE signoz_traces.signoz_index_v2; \
TRUNCATE TABLE signoz_traces.signoz_spans; \
TRUNCATE TABLE signoz_traces.top_level_operations; \
TRUNCATE TABLE signoz_traces.usage_explorer; \
TRUNCATE TABLE signoz_traces.usage;"

@echo "Done. Traces & logs are cleared, but graphs may still show old content."

# Remove SigNoz from the cluster
# K9s into the Signoz cluster
[group('signoz')]
delete-signoz: (delete-cluster _name_signoz)
k9s-signoz:
k9s --context {{ _ctx_signoz }}

[group('signoz')]
[private]
Expand All @@ -220,6 +235,11 @@ apply-collector kube_context:
--set presets.otlpExporter.enabled=true \
--set presets.loggingExporter.enabled=true

# Remove SigNoz from the cluster
[group('signoz')]
delete-collector:
helm uninstall k8s-infra

[group('signoz')]
[private]
apply-signoz kube_context:
Expand Down

0 comments on commit ee3991b

Please sign in to comment.