Extract hang telemetry into a reusable hang_telemetry crate (#64874)
Moves the "Hang Incidents" telemetry pipeline out of the `zed` binary
crate into a new `hang_telemetry` library crate, so other GPUI apps
(Delta) can depend on it instead of keeping a copy of the reporter.
Updating the telemetry schema in Zed then only requires bumping the Zed
dependency in those apps to get the same schema.
The crate owns everything that defines the data:
- `hang_threshold()` and `frame_budget()`, which decide what counts as
an incident
- `HangTelemetry`, which polls a `HangDetector` over the foreground
journal, serializes incidents relative to startup, and batches them
(largest 10 stalls, threshold/budget counts, stall p50/p95/max, 30
minute send interval)
- the event name and property shape, returned as a
`telemetry_events::FlexibleEvent`
Delivery stays with the app: Zed sends the event with
`telemetry::send_event`, while other apps route it through their own
telemetry pipeline. `crates/zed/src/reliability/hang_detection.rs` now
uses the crate; logging, task traces, and the dev hang actions are
unchanged, and the emitted event is identical to before.
Tests covering batching, counter/histogram resets, empty report windows,
and the exact wire shape live in the new crate.
Release Notes:
- N/A
---------
Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
1b572a2bd0Anthony Eid committed on 9/28/2026, 2:27:46 PM· committed by GitHubparent5becf8b