Skip to main content

Crate detritus

Crate detritus 

Source
Expand description

Client SDK for Detritus ingestion.

§Features

  • minidump (enabled by default) — capture native minidumps via minidumper-child on Linux, Windows, and macOS. With the feature off (or on Android) install_panic_hook falls back to the portable PanicKind::PanicTarball bundle and the minidumper-child dependency 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§

BuildInfo
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.
ClientTlsConfig
TLS configuration, CA certificates, and client identities for log transport. Configures TLS settings for endpoints.
CrashShipper
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.
LayerBuilder
Tracing subscriber layer API. Tracing subscriber layer API. Tracing subscriber layer API. Builder for Layer.
PanicHookConfig
Panic-hook crash capture API. Panic-hook crash capture API. Panic-hook crash capture API. Configuration for the process-wide panic hook.
ShipConfig
Offline crash spool shipping API. Offline crash spool shipping API. Offline crash spool shipping API. Configuration knobs for crash-dump upload compression.
SourceId
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§

CompressionEncoding
Supported OTLP/gRPC message compression algorithms. The compression encodings Tonic supports.
LayerError
Tracing subscriber layer API. Tracing subscriber layer API. Tracing subscriber layer API. Errors returned while building or flushing a Layer.
PanicHookError
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.
PanicKind
Panic-hook crash capture API. Panic-hook crash capture API. Panic-hook crash capture API. Crash artifact strategy used by install_panic_hook.
ShipError
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_config but 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_crashes but with explicit compression settings.