Installation
Quick start
collect.tell.rs:50000, batches up to 100 events, and flushes every 10 seconds or when you call close().
Configuration
Use one of the two presets, or build a custom config.Tracking events
Every tracking method takesuser_id as its first parameter. Calls never block or panic — errors go to the optional on_error callback.
Standard event names
The SDK provides typed constants for common events so you don’t have to remember exact strings:Super properties
Register properties that get merged into everytrack, group, and revenue call:
Structured logging
Send logs alongside events through the same pipeline. Each log has an RFC 5424 severity level.service parameter is optional — pass None to default to "app". Convenience methods are available for all nine levels: log_emergency, log_alert, log_critical, log_error, log_warning, log_notice, log_info, log_debug, and log_trace.
You can also use the generic log method with an explicit level:
Properties
You have three ways to pass properties:Props and props! write JSON bytes directly to a buffer, skipping the intermediate serde_json::Value allocation. Use them on hot paths.
Lifecycle
close() before your process exits to avoid losing buffered events. It blocks up to close_timeout (default 5 seconds).
Sharing across threads
Tell is Clone + Send + Sync. Internally it wraps everything in an Arc, so cloning is cheap:
Error handling
The constructor and lifecycle methods returnResult:
track, identify, log_*, etc.) never return errors. Invalid input (empty user ID, event name too long) is reported through the on_error callback:
Advanced
Configuration reference
| Parameter | Default (production) | Default (development) | Description |
|---|---|---|---|
endpoint | collect.tell.rs:50000 | localhost:50000 | TCP collector address |
batch_size | 100 | 10 | Events per batch before auto-flush |
flush_interval | 10s | 2s | Time between auto-flushes |
max_retries | 3 | 3 | Retry attempts on send failure |
close_timeout | 5s | 5s | Max wait on close() |
network_timeout | 30s | 30s | TCP connect timeout |
on_error | silent | silent | Error callback |
Validation rules
| Field | Rule |
|---|---|
| API key | 32-character hex string |
| User ID | Non-empty |
| Event name | 1–256 characters |
| Log message | 1–65,536 characters |
| Group ID | Non-empty |
| Revenue amount | Positive number |
Retry behavior
On TCP send failure, the SDK retries with exponential backoff: 1s initial delay, 1.5x multiplier, 20% jitter, capped at 30s. Aftermax_retries attempts, the batch is dropped and the error reported via on_error.