# V2 Telemetry Alerting Rules

Phase 72.5.2.13 adds `@v2/telemetry-alerting-rules`, the operational alerting
surface for crash spikes, player count drops, and matchmaking wait regressions.

The service composes `@iris/analytics-realtime` alert rule types through
`buildV2TelemetryAlertingRulesSurface`. It evaluates aggregate telemetry samples
and emits deterministic alert rows for:

- `crash-rate-spike-2x`: crash rate multiplier greater than or equal to `2`
- `player-count-drop-20pct`: player count drop greater than or equal to `0.2`
- `matchmaking-wait-time-3min`: p95 matchmaking wait greater than or equal to
  `180` seconds

Raw account IDs are not accepted or emitted. Inputs are operational aggregates
such as crash rate, baseline crash rate, current player count, baseline player
count, and p95 matchmaking wait time.

## Policy

- Policy ID: `v2-telemetry-alerting-rules-v1`
- Source library: `@iris/analytics-realtime`
- Rule families: crash rate spike, player count drop, matchmaking wait time
- Thresholds: crash rate spike `2x`, player count drop `20%`, matchmaking wait
  `3 minutes`
- Privacy: aggregate samples only; raw account IDs are never exposed

## Output

The surface emits:

- the three `AlertRule` definitions used by operators and gates
- latest-sample evaluations per rule family
- deterministic active alert rows with rule ID, severity, observed value, and
  threshold
- summary counts for active, critical, and warning alerts
- chart-ready copies of evaluations and alerts

## Gates

`check-v2-telemetry-alerting-rules.py` validates the contract, service package,
source tokens, tests, docs, workflow wiring, Horde gates, and the Phase 72
checklist item. Required gates are `telemetry-alerting-rules-service-present`,
`telemetry-alerting-rules-crash-rate-spike`,
`telemetry-alerting-rules-player-count-drop`,
`telemetry-alerting-rules-matchmaking-wait`, and
`telemetry-alerting-rules-ci-wired`.

Targeted verification:

```bash
pnpm --filter @v2/telemetry-alerting-rules run typecheck
pnpm --filter @v2/telemetry-alerting-rules run test
python V2/ue/Tools/check-v2-telemetry-alerting-rules.py
```
