offline_protocol_telemetry_wire/lib.rs
1//! Wire-format types for the telemetry ingest, shared between the SDK's
2//! telemetry pipe (`offline-protocol`, `telemetry::pipe`) and the ingest
3//! service that receives what it sends.
4//!
5//! The surface is deliberately opaque at the envelope: a [`RawEvent`] is a
6//! `type` discriminator, a `ts_ms` timestamp and a `data` JSON payload, and a
7//! [`Batch`] is a list of them under one session. The typed layer ([`Event`]
8//! and the per-type `*Data` structs, reached through [`classify`]) is what the
9//! ingest binds to columns; the pipe builds every payload it sends through
10//! those same structs, so a payload that serializes here is one the ingest
11//! accepts.
12//!
13//! `batch.rs` and `event.rs` are copied from the ingest service's own wire
14//! crate. Keep them that way: an edit that is not additive belongs upstream
15//! first, and `tests/fixtures.rs` pins the canonical batch byte for byte.
16
17#![deny(unsafe_code)]
18
19pub mod batch;
20pub mod event;
21
22pub use batch::{Batch, BatchId, DeviceId, OsKind, SessionId, WireVersion, CURRENT_WIRE_VERSION};
23pub use event::{classify, Event, RawEvent};