Skip to content

vox-telemetry-otlp API Reference (generated)

Crate: vox-telemetry-otlp · Version: 0.6.0 · Target: Library (lib.rs)

Feature-gated OTLP exporter for vox-telemetry: redacts at egress and ships events as OTLP LogRecords. Compiles to a no-op shim unless the remote feature is on.

OTLP egress for vox-telemetry. The pure core (project/redact/otlp_json) always compiles (serde only). The remote feature adds the async network uploader — the compile-out unit: --no-default-features builds contain zero reqwest/network symbols.

FeatureDefault / Enables
default—
remotedep:reqwest, dep:governor, dep:tokio
DependencyKind
vox-telemetryNormal
ModuleDescription
otlp_json—
project—
redact—
upload—
Dependency Topology, diagram 13 nodes, 2 edges: vox-telemetry-otlp → vox-telemetry; vox-cli → vox-telemetry-otlpvox-telemetry-otlpvox-telemetryvox-cli
Diagram source
graph {
direction: right
node vox_telemetry_otlp: "vox-telemetry-otlp"
node vox_telemetry: "vox-telemetry"
vox_telemetry_otlp -> vox_telemetry
node vox_cli: "vox-cli"
vox_cli -> vox_telemetry_otlp
}
Consumer CrateRole
vox-cliDirect workspace dependent
KindSymbolSignatureSourceDescription
fnotlp_json::to_otlp_logpub fn to_otlp_log(rec: &RedactedRecord, install_id: &str) -> Valuecrates/vox-telemetry-otlp/src/otlp_json.rs#L14-L45Encode a RedactedRecord into an OTLP/HTTP logs JSON envelope. The envelope is a minimal resourceLogs wrapper compatible with the OTLP/HTTP logs JSON framing (Content-Type: application/json). No opentelemetry SDK is used — we hand-encode the stable format with serde_json to avoid pulling the logs feature into the workspace-wide 0.29 otel pin. install_id is added to resource.attributes so the server can group events by installation (k-anonymity enforced server-side; the install_id itself is opaque and not user-identifiable).
fnotlp_json::merge_otlp_log_batchpub fn merge_otlp_log_batch(envelopes: &[Value]) -> Valuecrates/vox-telemetry-otlp/src/otlp_json.rs#L68-L111Merge multiple OTLP/HTTP log envelopes (or individual logRecords) into a single batched resourceLogs envelope (up to batch.len() records) so the uploader sends at most 1 HTTP POST per batch instead of N sequential requests (TELEM-03).
fnupload::upload_pending_otlppub async fn upload_pending_otlp(spool_dir: &Path, endpoint: &str) -> std::io::Result<usize>crates/vox-telemetry-otlp/src/upload.rs#L15-L17Async OTLP/HTTP uploader (feature remote only). Reads pending clean spool records and POSTs them to the central OTLP endpoint when is_remote_allowed() returns true.
fnupload::upload_pending_otlp_with_authpub async fn upload_pending_otlp_with_auth(crates/vox-telemetry-otlp/src/upload.rs#L25Async OTLP/HTTP uploader with optional Bearer authentication token (TELEM-02, TELEM-03). Enforces vox_telemetry::config::is_remote_allowed(), reads .json files from spool_dir (or spool_dir/pending if present), batches up to [MAX_OTLP_BATCH_RECORDS] records into a single resourceLogs envelope via [merge_otlp_log_batch], POSTs to endpoint, and deletes acknowledged files on HTTP 2xx.
structupload::PendingRecordpub struct PendingRecordcrates/vox-telemetry-otlp/src/upload.rs#L124-L127A single pending record read from the spool, ready for upload.