Queue behavior
Events are enqueued in memory (or on disk) and flushed in batches:| Setting | Default | Effect |
|---|---|---|
flushIntervalMs | 2000 | Background flush every 2 seconds |
maxBatchSize | 25 | Max events per POST /v1/events |
maxQueueSize | 5000 | Max queued events before drop policy applies |
retryAttempts | 3 | Retries on failed flush |
retryBaseDelayMs | 250 | Base delay between retries |
queueDropPolicy | drop_oldest | Drop oldest or newest when queue is full |
queueStoragePath | none | Persist queue to disk for durability |
Flush on demand
withRun / with_run flushes before completing a run. Call flush() explicitly in serverless handlers before returning.
Graceful shutdown
Always shut down the client when your process exits:shutdown() stops the flush timer and sends remaining queued events.
Queue diagnostics
Idempotency
Provide a deduplication key to avoid duplicate events on retry:Next steps
Diagnose your setup
Doctor and queue health checks.
Redact secrets
Strip sensitive data from events.
