S3 Tracing
A Rust crate that provides a tracing layer for efficiently sending structured logs to AWS S3 Express One Zone buckets.
Features
- High Performance: Optimized for AWS S3 Express One Zone storage class for ultra-low latency
- Buffered Logging: Smart buffering with configurable size limits and automatic flushing
- Structured Output: JSON-formatted logs with timestamps and span timing information
- Configurable: Environment variable support with programmatic overrides
- Async/Tokio Compatible: Built for modern async Rust applications
- Automatic Partitioning: Splits large log files into multiple parts when size limits are reached
Quick Start
use ;
use *;
use Arc;
use ;
async
Environment Variables
The crate supports the following environment variables:
S3_TRACING_AWS_REGION
- AWS region (default: "us-west-2")S3_TRACING_BUCKET
- S3 bucket nameS3_TRACING_AWS_ACCESS_KEY_ID
- AWS access key IDS3_TRACING_AWS_SECRET_ACCESS_KEY
- AWS secret access key
Log Format
Logs are stored as JSON objects with the following structure:
File Organization
Log files are organized by date and partitioned when they exceed size limits:
2024-01-01/
├── 0/
│ └── app-logs-{uuid}.log
├── 1/
│ └── app-logs-{uuid}.log
└── ...