Cargo features and requirements¶
Features¶
| Feature | Default | What it adds |
|---|---|---|
remote-sinks |
off | HttpSink, HttpSinkConfig, OtlpSink, OtlpSinkConfig |
default = [] — there are no default features. A plain
rtb-telemetry = "0.7" gives you NoopSink, MemorySink, FileSink, the
consent module and the machine-ID derivation, and nothing that can reach
the network.
Turning remote-sinks on compiles in reqwest, url, secrecy, tonic and the
OpenTelemetry stack (opentelemetry, opentelemetry_sdk,
opentelemetry-otlp). That is a large dependency subtree to audit and to
build; leaving the feature off means none of it is compiled or linked at
all, not merely unused.
The http_sink and otlp_sink modules do not exist without the feature.
If use rtb_telemetry::HttpSink fails to resolve, the feature is off.
Minimum supported Rust version¶
rust-version = "1.82", edition 2021. Development in this repository pins
an exact toolchain (rust-toolchain.toml), but consumers only need 1.82 or
newer.
What the crate needs at runtime¶
- A Tokio runtime.
emitandflushareasync, andFileSinkuses Tokio's filesystem API. The crate depends ontokiowith thefullfeature set, so it is already in your tree. - TLS via rustls.
reqwestis pulled in with default features off andrustlson, soHttpSinkdoes not need OpenSSL on the build host. - A readable machine ID, ideally.
MachineId::derivereads the host machine ID throughmachine-uidwhen the policy isEnabled. What happens when it cannot is covered in Machine identity.
Always-on dependencies¶
machine-uid, sha2, tokio, async-trait, serde, serde_json,
thiserror, miette, time, toml, uuid and
rtb-redact.
rtb-redact is not optional. It is what redaction is made of, and making
it optional would let a build silently drop the scrubbing step from the
sinks that write off-process.
Safety¶
src/lib.rs carries #![forbid(unsafe_code)] — the crate contains no
unsafe blocks and cannot grow one without the compiler refusing.