Expand description
Client SDK for Detritus ingestion.
§Features
minidump(enabled by default) — capture native minidumps viaminidumper-childon Linux, Windows, and macOS. With the feature off (or on Android)install_panic_hookfalls back to the portablePanicKind::PanicTarballbundle and theminidumper-childdependency is dropped.
Public API is limited to Layer, LayerBuilder, install_panic_hook,
ship_pending_crashes, ship_pending_crashes_with_config,
ship_pending_crashes_using_stored_config,
ship_pending_crashes_using_stored_config_with_config, CrashShipper, ShipConfig,
DEFAULT_SENT_RETENTION_DAYS, PanicHookConfig, PanicKind, and
SourceId, and the compression and TLS configuration re-exports.
Everything else is an implementation detail and may change between releases.
This setup enables zstd-compressed log exports to a Detritus 0.2 receiver.
use std::{path::PathBuf, time::Duration};
use detritus::{CompressionEncoding, Layer, SourceId};
use secrecy::SecretString;
use url::Url;
use uuid::Uuid;
let source = SourceId {
project: "detritus".to_owned(),
platform: "linux".to_owned(),
version: "0.1.0".to_owned(),
install_id: Uuid::nil(),
};
let layer = Layer::builder()
.endpoint(Url::parse("http://127.0.0.1:4317").unwrap())
.compression(CompressionEncoding::Zstd)
.token(SecretString::from("secret-token"))
.source(source)
.queue_dir(PathBuf::from("observability-spool/logs"))
.flush_interval(Duration::from_secs(5))
.build()
.unwrap();Call install_default_crypto_provider once before constructing the first
HTTPS-backed client such as the crash shipper. It is safe to call more than
once; repeated calls are ignored after the first successful install.
Modules§
- compression
- Zstd compression helpers for crash dump and attachment bytes.
Structs§
- Build
Info - Build metadata type re-exported for panic-hook configuration. Crash-report schema types re-exported for the common import path. Build metadata captured with a crash report.
- Certificate
- TLS configuration, CA certificates, and client identities for log transport. Represents a X509 certificate.
- Client
TlsConfig - TLS configuration, CA certificates, and client identities for log transport. Configures TLS settings for endpoints.
- Crash
Shipper - Offline crash spool shipping API. Offline crash spool shipping API. Offline crash spool shipping API. Reusable crash uploader with pooled HTTP connections and an in-memory token.
- Identity
- TLS configuration, CA certificates, and client identities for log transport. Represents a private key and X509 certificate.
- Layer
- Tracing subscriber layer API. Tracing subscriber layer API. Tracing subscriber layer API. A tracing subscriber layer that exports events to the observability server.
- Layer
Builder - Tracing subscriber layer API.
Tracing subscriber layer API.
Tracing subscriber layer API.
Builder for
Layer. - Panic
Hook Config - Panic-hook crash capture API. Panic-hook crash capture API. Panic-hook crash capture API. Configuration for the process-wide panic hook.
- Ship
Config - Offline crash spool shipping API. Offline crash spool shipping API. Offline crash spool shipping API. Configuration knobs for crash-dump upload compression.
- Source
Id - Build metadata type re-exported for panic-hook configuration. Source identity re-exported for the common import path. Identifies the game build and installation that produced a payload.
Enums§
- Compression
Encoding - Supported OTLP/gRPC message compression algorithms. The compression encodings Tonic supports.
- Layer
Error - Tracing subscriber layer API.
Tracing subscriber layer API.
Tracing subscriber layer API.
Errors returned while building or flushing a
Layer. - Panic
Hook Error - Panic-hook crash capture API. Panic-hook crash capture API. Panic-hook crash capture API. Errors returned while installing or running the panic hook setup.
- Panic
Kind - Panic-hook crash capture API.
Panic-hook crash capture API.
Panic-hook crash capture API.
Crash artifact strategy used by
install_panic_hook. - Ship
Error - Offline crash spool shipping API. Offline crash spool shipping API. Offline crash spool shipping API. Errors returned while shipping pending crash reports.
Constants§
- DEFAULT_
SENT_ RETENTION_ DAYS - Offline crash spool shipping API. Offline crash spool shipping API. Offline crash spool shipping API. Default number of days to keep successfully sent crash entries.
Functions§
- install_
default_ crypto_ provider - Installs aws-lc-rs as the process-wide rustls crypto provider.
- install_
panic_ hook - Panic-hook crash capture API. Panic-hook crash capture API. Panic-hook crash capture API. Installs a process-wide hook that synchronously spools panic artifacts.
- ship_
pending_ crashes - Offline crash spool shipping API.
Offline crash spool shipping API.
Offline crash spool shipping API.
Ships pending crash artifacts and moves successful entries to
sent/. - ship_
pending_ crashes_ using_ stored_ config - Offline crash spool shipping API. Offline crash spool shipping API. Offline crash spool shipping API. Ships pending crash artifacts using each entry’s stored endpoint.
- ship_
pending_ crashes_ using_ stored_ config_ with_ config - Offline crash spool shipping API.
Offline crash spool shipping API.
Offline crash spool shipping API.
Like
ship_pending_crashes_using_stored_configbut with explicit compression settings. - ship_
pending_ crashes_ with_ config - Offline crash spool shipping API.
Offline crash spool shipping API.
Offline crash spool shipping API.
Like
ship_pending_crashesbut with explicit compression settings.