blob: adeea2bc92ef192ef6ce1f572d8e9ced96fa9706 (
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
49
50
51
52
53
54
55
56
|
# Quick Start
Minimal path to push metrics and see them in Prometheus or ClickHouse.
## 1. Build
```bash
go build -o epimetheus cmd/epimetheus/main.go
# Or: mage build
```
## 2. Run (Prometheus path)
**Realtime mode** (Pushgateway + Prometheus):
1. Deploy and expose Pushgateway (see [Kubernetes](../operations/kubernetes.md) or run Pushgateway locally).
2. Ensure Prometheus scrapes Pushgateway (see [Setup: Prometheus](../operations/setup-prometheus.md)).
3. Port-forward if needed, then run:
```bash
kubectl port-forward -n monitoring svc/pushgateway 9091:9091 &
./epimetheus -mode=realtime -continuous
```
Metrics are pushed every 15 seconds. Stop with Ctrl+C.
**Watch mode** (Remote Write; preserves timestamps):
1. Enable the Prometheus Remote Write receiver (see [Setup: Prometheus](../operations/setup-prometheus.md)).
2. Port-forward Prometheus, then run:
```bash
kubectl port-forward -n monitoring svc/prometheus-kube-prometheus-prometheus 9090:9090 &
./epimetheus -mode=watch -file=mydata.csv -metric-name=myapp \
-prometheus=http://localhost:9090/api/v1/write
```
## 3. View
- **Pushgateway:** http://localhost:9091
- **Prometheus:** http://localhost:9090 (e.g. query `epimetheus_test_requests_total` or your metric name)
- **Grafana:** Add Prometheus as a datasource and import the Epimetheus dashboard (see [Grafana Dashboard](../reference/grafana-dashboard.md)).
## ClickHouse path (watch only)
1. Run ClickHouse (e.g. `sudo systemctl start clickhouse-server` or Docker). See [Setup: ClickHouse](../operations/setup-clickhouse.md).
2. Run watch mode with ClickHouse:
```bash
./epimetheus -mode=watch -file=test-data/watch-clickhouse-test.csv \
-metric-name=watch_test -clickhouse=http://localhost:8123 -prometheus=
```
3. Verify: `./scripts/verify-clickhouse.sh`
For all modes and options see [Operating Modes](modes.md) and [CLI Reference](../reference/cli.md).
|