Expand description
§allstak
Native Rust SDK for the AllStak observability platform. It implements the AllStak ingest wire protocol directly — error monitoring, performance tracing, structured logging and release-health sessions — with a familiar Hub / Scope / Client model.
§Quick start
let _guard = allstak::init(allstak::ClientOptions {
api_key: "<your-key>".into(),
release: Some("my-service@1.0.0".into()),
environment: Some("production".into()),
..Default::default()
});
allstak::configure_scope(|scope| {
scope.set_tag("region", "eu-central");
});
allstak::capture_message("service started", allstak::Level::Info);
// `_guard` flushes pending events when it drops.For the least possible configuration, init_from_env reads options from
the environment and installs the panic hook plus (on the tracing feature)
the global tracing subscriber so logs, spans and database queries are
captured automatically.
§Features
panic(default): install a global panic hook that captures crashes.tracing: atracing_subscriberlayer bridging events and spans.axum: a tower layer that records inbound requests and handler errors.actix: actix-web middleware with the same behavior.reqwest-middleware: outbound HTTP auto-instrumentation — anhttp.clientspan, trace-context header injection, and an outbound HTTP request record, per call, with no per-call code.sqlx: database auto-instrumentation — atracinglayer that turns sqlx’s query telemetry into DB query records tied to the active span.anyhow: capture ananyhow::Errorchain.
Re-exports§
pub use db::capture_query as capture_db_query;pub use db::normalize_query;pub use db::query_hash;pub use db::query_type;pub use diagnostics::Diagnostics;pub use options::ClientOptions;pub use options::IntoClientOptions;pub use options::SessionMode;pub use options::DEFAULT_HOST;pub use protocol::Breadcrumb;pub use protocol::ErrorEvent;pub use protocol::Frame;pub use protocol::Heartbeat;pub use protocol::Level;pub use protocol::RequestContext;pub use protocol::SessionStatus;pub use protocol::User;pub use integrations::reqwest::instrumented_client as instrumented_http_client;pub use integrations::reqwest::instrumented_client_from as instrumented_http_client_from;pub use integrations::reqwest::AllstakHttpMiddleware;
Modules§
- backtrace
- Backtrace capture and in-app frame marking.
- db
- Database query helpers: statement normalization, fingerprinting, and a
convenience for recording a
DbQueryRecordtied to the active span. - diagnostics
- Privacy-safe SDK diagnostics.
- envelope
- Envelope: a typed unit of work the transport delivers to a single ingest endpoint. Each variant carries an already-serialized JSON body plus its data category (used for rate-limit accounting).
- integrations
- Feature-gated framework and logging integrations.
- options
- Client configuration.
- panic
- Panic integration.
- propagation
- Distributed-trace propagation header parsing and stamping.
- protocol
- Wire-protocol types for the AllStak ingest API.
- scrub
- Value-pattern PII scrubbing.
- transport
- Transport layer.
- util
- Small helpers: timestamps, ids, and the SDK identity constants.
Structs§
- Client
- A bound client: configuration + transport + integration pipeline.
- Client
Init Guard - RAII guard returned by
init. Flushes pending events and ends the active application session when dropped. - Hub
- Central manager binding a
Clientto a stack ofScopes. - Scope
- Contextual data applied to events captured while it is active.
- Scope
Guard - Pops the top scope off its hub when dropped.
- Session
- A single in-flight release-health session.
- Span
- An in-flight span. On
Span::finish(or drop) it is sent to the active client as a span record.
Traits§
- Integration
- An installable extension that participates in the event pipeline.
Functions§
- add_
breadcrumb - Add a breadcrumb to the current scope.
- capture_
anyhow - Capture an
anyhow::Error, walking its chain into the message and attaching the formatted backtrace lines. - capture_
error - Capture a
std::error::Error. - capture_
event - Capture a pre-built error event.
- capture_
message - Capture a message at
level. - configure_
scope - Mutate the current scope.
- end_
session - End the active session.
- end_
session_ with_ status - End the active session with an explicit status.
- event_
from_ error - Build an event from a
std::error::Errorwithout capturing it. - flush
- Flush the current hub’s transport queue.
- get_
diagnostics - Privacy-safe SDK diagnostics. Contains counters and queue sizes only.
- init
- Initialize the SDK and bind a client to the main hub.
- init_
from_ env - Zero-config initialization from the process environment.
- last_
event_ id - The last accepted event id on any hub.
- set_
user - Set the active user on the current scope.
- start_
session - Start a release-health session on the current hub.
- start_
span - Start a standalone span. Convenience for
Span::transaction. - start_
transaction - Start a root transaction. Convenience for
Span::transaction. - with_
scope - Run
bodywith a temporary scope configured byscope_fn.