summaryrefslogtreecommitdiff
path: root/docs/operations/cleanup.md
blob: 7835b21418eb5f5899f362449ba550096c07654f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Cleanup

## Benchmark data in Prometheus

To remove benchmark metrics from Prometheus, use the provided script:

```bash
# Port-forward to Prometheus if needed
kubectl port-forward -n monitoring svc/prometheus-kube-prometheus-prometheus 9090:9090 &

./scripts/cleanup-benchmark-data.sh
```

The script deletes all `epimetheus_benchmark_*` series via the Admin API and runs clean_tombstones.

**Manual deletion:**

```bash
# Delete a specific metric
curl -X POST 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]=epimetheus_benchmark_cpu_usage'

# Clean tombstones
curl -X POST http://localhost:9090/api/v1/admin/tsdb/clean_tombstones
```

The Admin API must be enabled on Prometheus (see [Setup: Prometheus](setup-prometheus.md)).

## Other cleanup

**Stop port-forwards:**

```bash
pkill -f "port-forward.*9091"
pkill -f "port-forward.*9090"
pkill -f "port-forward.*3000"
```

**Remove test metrics from Pushgateway:**

```bash
curl -X DELETE http://localhost:9091/metrics/job/example_metrics_pusher
```

**Uninstall Pushgateway (Helm):**

```bash
helm uninstall pushgateway -n monitoring
```