openvibers/openrestream Commits

OpenRestream README: request telemetry (telemetry_samples, one-minute aggregates, 14 days) (#82)

OP OpenVibers committed 29 days ago · ccbf6849fe · 1 file, +1 −0

Changes

ddiff --git a/README.md b/README.md
iindex 3a70868..0474946 100644
---- a/README.md
++++ b/README.md
@@@ -69,6 +69,7 @@ openre-api (4500) openre-session-coordinator openre-rtmp-inges
- **Leases.** Every heartbeat (2 s) renews the worker and the lease of every session it owns in one transaction. A worker silent for `OPENRE_WORKER_LEASE_MS` (15 s) is `lost`: its sessions fail (`openre.session.failed`), its outputs go back to `pending` for another worker. A lost worker that wakes up drops its transports and exits.
- **Isolation.** An output only ever changes its own row. A dead destination fails (`openre.output.failed`, destination cooldown 15 min → 24 h) and the session stays live (`test/rtmp-e2e.test.js`, `test/sessions.test.js`, `test/coordinator.test.js`).
- **Store.** PostgreSQL 18 through PgBouncer (`ov_openre` on the host's data role, ADR-035; schema in [migrations/](migrations/)), shared by every OpenRestream process. Every transaction is SERIALIZABLE (`server/store/index.js`): an ingest worker admitting a publish and the coordinator failing a lost worker's session conflict, and PostgreSQL makes one of them retry. Admission is async, so the RTMP worker admits a publish before node-media-server's own publish handling runs. Valkey holds the API's per-actor limit counters.
++- **Telemetry.** Each HTTP request is aggregated by route template, method and status class, never by raw URL; `/shared`, static assets, health, readiness and `/metrics` are not counted. Once a minute one `http.request` sample per key, plus the active-requests, p95 latency and event-loop-lag gauges, is written to this service's own `telemetry_samples` table (openvibe-sdk 0.46 telemetry, the `platform.telemetry-sample@1` shape); rows older than 14 days are deleted daily. `server/app.js` mounts openvibe-sdk's `telemetryMiddleware` (a no-op until init) and `server/index.js` calls `telemetry.init()` at production start, runs the retention and flushes on stop. The table is created by migration `migrations/0005_telemetry.sql`.
## Running it