New features
Optionaltracing feature (off by default, OpenTelemetry-ready)
whatsapp-rust now ships an opt-in tracing Cargo feature that instruments the library end-to-end — connect, receive/decrypt, send, IQ, app state, pairing, media, receipts, retries, notifications, and session/crypto. With the feature off there is no tracing dependency and the instrumentation attributes vanish at compile time, so the default build has zero overhead.
The library only emits spans and events. Your application installs the subscriber (and any OpenTelemetry/OTLP layer). The existing log::{info,warn,error}! calls keep working and bridge into the subscriber via tracing-log, so they appear as events attached to the active wa.* span.
Cargo.toml
wa.{conn,recv,send,iq,appstate,pair,media,receipt,retry,pdo,notif,session,usync,bot}.* taxonomy so you can filter or build dashboards per area. Connection-lifecycle spans (wa.conn.connect, wa.conn.disconnect, wa.conn.reconnect, wa.conn.run, wa.conn.logout) are at info level; everything else is debug/trace. Failures surface at ERROR via err(Debug).
PII-redacted JIDs across spans and logs
Jid::observe() renders LID, group, broadcast, newsletter, and bot JIDs in full (pseudonymous or non-personal, so peers and chats still correlate) and replaces phone-number user JIDs with pn#<token>. The token is a keyed SipHash with a process-lifetime random key, not a plain digest — an unkeyed hash of an E.164 number is reversible by precomputation, while the keyed scheme is not. Legacy group IDs (<creator-phone>-<timestamp>) keep the timestamp and redact only the numeric prefix. observe_protocol_address() applies the same scheme to Signal ProtocolAddress names. The library’s own log calls now route JIDs and addresses through these helpers, so the bridged log lines carry the same redaction as the span fields.
For local debugging where raw phone numbers are required, enable the tracing-pii feature (off by default, never enable in production).
See Observability with tracing for the full wiring guide, including an OpenTelemetry / OTLP example.