Rust SDK
The Monk Rust SDK is a production-grade async client for the Monk Events API (events-api.monk.com). It handles retries, circuit breaking, client-side buffering, and graceful shutdown out of the box.
Features
- Automatic retries with exponential backoff and full jitter
- Circuit breaker to avoid hammering a degraded server
- In-memory event buffer with background batch flushing
- Parallel concurrent flushes (configurable worker pool)
- Configurable backpressure (
FailFastorBlock) - Flush failure callbacks for alerting and dead-letter handling
- Graceful shutdown that waits for in-flight flushes
- Client-side validation (fail fast, save a round-trip)
- Idempotency key management (auto-generated UUIDv4 when omitted)
- Typed request/response models with
serde - TLS via
rustls(no OpenSSL dependency)
Installation
Add the SDK to yourCargo.toml:
Quick Start
Clone and Arc-wrapped, so you can share it across threads and tasks cheaply.
Architecture
Next Steps
Ingesting Events
Send single, batch, or buffered events
Querying Data
List events and query aggregated usage
Configuration
Customize retries, buffering, and timeouts
Error Handling
Handle errors gracefully with typed variants