# Phase 1 parity baseline (captured 2026-07-20 from Pi Prometheus :30090)

| check | Pi value |
|---|---|
| active targets (job scrapeUrl health) | see list below — 9 targets, all `up` |
| count(up==1) | 9 |
| pool gen-rate metric name | `llamacpp:predicted_tokens_seconds` (value 24.0468 tok/s at capture, instance 192.168.8.178:8080, job ahel-pool) |
| pushgateway in use | **YES** — see note below |

## Active targets (Step 1 output)

```
bifrost-gateway http://192.168.8.168:8081/metrics up
embed-swap http://192.168.8.152:8082/metrics up
ahel-pool http://192.168.8.178:8080/metrics up
m4-nodes http://192.168.8.178:9101/metrics up
m4-nodes http://192.168.8.152:9101/metrics up
netdata-pi http://192.168.8.240:19999/api/v1/allmetrics?format=prometheus up
prometheus http://localhost:9090/metrics up
pushgateway http://pushgateway.monitoring.svc.cluster.local:9091/metrics up
qdrant http://192.168.8.152:6333/metrics up
```

## Pushgateway verdict: IN USE (keep a pushgateway job in the M1 config)

The plan's naive check (`{job="pushgateway"}`) returned 61 series, all pushgateway
self-metrics (go_*, process_*, pushgateway_*) — which alone would look like "unused".
But the Pi scrape config uses `honor_labels: true`, so pushed groups appear under
their *own* job label, not `job="pushgateway"`. Deeper check found:

- `pushgateway_http_requests_total{handler="push",code="200"}` = 39 (process started
  2026-07-19 22:10) → ~37 successful pushes in <24 h, i.e. roughly every 30 min.
- One pushed group: `job="speedtest"`, last push 2026-07-20 16:53 (`push_time_seconds`).
- Series in the group: `speedtest_download_bits_per_second` (85 900 000),
  `speedtest_upload_bits_per_second` (83 910 000),
  `speedtest_ping_latency_milliseconds` (4), `speedtest_up` (1),
  plus `push_time_seconds` / `push_failure_time_seconds`.

**Consequences for Task 4 (per plan):** KEEP a pushgateway job in the M1 config —
M1-local pushgateway on port 9091, scraped with `honor_labels: true` so the
speedtest job label survives.
**FLAG FOR KARL:** some cron/script pushes speedtest results ~every 30 min to the
k8s pushgateway (`pushgateway.monitoring.svc.cluster.local:9091`, NodePort unknown).
The pusher must be found and repointed to the M1 pushgateway before Phase 4 culls
the Pi stack, or the speedtest series silently dies.

## Expectation for Task 6 parity gate

M1 Prometheus (Task 4) must show the same targets up, with these deltas:
- `m4-nodes` job renamed `node` and extended with M1 itself (127.0.0.1:9101) → +1 target
- `prometheus` self-scrape becomes M1-local
- pushgateway job KEPT (M1-local :9091) since it is in use — expect it `up`, and the
  `speedtest` group present once the pusher is repointed (not gated for Phase 1;
  the Pi pushgateway keeps receiving pushes until the pusher moves)
- netdata-pi stays scraped until Phase 4

Baseline up-count 9 → expected M1 up-count 10 (9 + M1 node exporter; pushgateway kept).
`llamacpp:predicted_tokens_seconds` must return data on the M1 instance.

## Parity result 2026-07-20 (Task 6 gate, M1 Prometheus 192.168.8.168:9090)

| check | Pi baseline | M1 observed | verdict |
|---|---|---|---|
| count(up==1) | 9 | **10** (= 9 + M1 node exporter; pushgateway kept M1-local) | PASS |
| pool gen-rate `llamacpp:predicted_tokens_seconds` | 24.0468 tok/s | **24.0468** tok/s (instance 192.168.8.178:8080, job ahel-pool) | PASS |
| active targets | 9 jobs, all up | 10 targets, **all up** — see list below | PASS |

M1 active targets at gate time (all `up`):

```
bifrost-gateway http://127.0.0.1:8081/metrics up
pushgateway http://127.0.0.1:9091/metrics up
node http://127.0.0.1:9101/metrics up
qdrant http://192.168.8.152:6333/metrics up
embed-swap http://192.168.8.152:8082/metrics up
node http://192.168.8.152:9101/metrics up
ahel-pool http://192.168.8.178:8080/metrics up
node http://192.168.8.178:9101/metrics up
netdata-pi http://192.168.8.240:19999/api/v1/allmetrics?format=prometheus up
prometheus http://localhost:9090/metrics up
```

Deltas vs Pi, all as planned: `m4-nodes` → `node` (+ M1 target), `prometheus`
self-scrape now M1-local, pushgateway now M1-local :9091 (speedtest pusher still
points at the Pi pushgateway — must be repointed before Phase 4, see flag above).
Dashboard verified rendering on MacBook Grafana (http://localhost:3000, dashboard
uid `ahel-overview`, as committed in `infra/grafana/build_dashboard.py`): all 8 up-dots green, Gen tok/s 24.0, throughput series live.

**VERDICT: PASS — Phase 2 unblocked.**
