Overview
Snuba can be installed and run in several ways depending on your use case. This guide covers:- Devservices - Recommended for local development (easiest)
- Docker Compose - Containerized deployment
- Local Development - Source installation with native dependencies
- Production Deployment - Production-ready configuration
Prerequisites
Before installing Snuba, ensure you have the following dependencies:- All Methods
- Docker
- Local Development
Required Services:
- ClickHouse 25.3+
- Apache Kafka (with Zookeeper)
- Redis 4.5+
- 8GB+ RAM (16GB recommended)
- 4+ CPU cores
- 20GB+ disk space
Method 1: Devservices (Recommended)
Devservices is the easiest way to get started with Snuba development. It automatically manages all service dependencies.Install Devservices
Install the devservices package:
Devservices requires Docker to be installed and running.
Build Rust Components (Optional)
If you need the Rust consumer functionality:This requires:
- Rust toolchain (install from rustup.rs)
- maturin for building Python extensions
Start Services with Devservices
Start required services (ClickHouse, Kafka, Redis):Services will be available at:
- ClickHouse:
localhost:9000(native),localhost:8123(HTTP) - Kafka:
localhost:9093 - Redis:
localhost:6379
Verify Installation
Test that Snuba is running correctly:Method 2: Docker Compose
For containerized deployment, use the provided Docker Compose configuration.Review Docker Compose Config
The repository includes
devservices/config.yml which defines all services:clickhouse- ClickHouse databasesnuba- Snuba API and consumers- Additional consumers for profiles, metrics, etc.
- Automatic health checks
- Proper networking
- Volume mounts for data persistence
Docker Configuration
The Snuba container can be configured using environment variables:Building Custom Docker Image
To build your own Snuba image:Method 3: Local Development Setup
For active development on Snuba itself, install from source with all development tools.Clone and Set Up Repository
- Creates a virtual environment
- Installs Python dependencies
- Builds Rust components
- Sets up pre-commit hooks
Install External Services
You still need ClickHouse, Kafka, and Redis. Use devservices:Or install them directly on your system:
- macOS
- Linux
Development Tools
Snuba includes several make targets for development:Configuration
Settings Files
Snuba uses different settings profiles:snuba.settings- Default settingssnuba.settings.docker- Docker/container settingssnuba.settings.test- Test environment settings
Key Configuration Options
ClickHouse Connection
ClickHouse Connection
Kafka Configuration
Kafka Configuration
Redis Configuration
Redis Configuration
API Server Settings
API Server Settings
Consumer Settings
Consumer Settings
Migrations
Snuba uses a migration system to manage ClickHouse schema changes.Running Migrations
Migration Groups
Migrations are organized by dataset/storage:events- Events/errors storagetransactions- Transaction storagemetrics- Metrics storageprofiles- Profiling storagereplays- Replay storagesearch_issues- Issue search storage
Verification
After installation, verify that everything is working:Check Admin UI
Open http://localhost:1219 in your browser to access the admin interface.
Production Deployment
For production deployments, consider the following:Scaling Considerations
API Servers
Run multiple API server instances behind a load balancer. Configure workers and threads based on CPU cores:
Consumer Replicas
Run multiple consumer instances for high throughput. Adjust batch timing based on replica count:
ClickHouse Cluster
Use distributed ClickHouse setup with:
- Multiple shards for horizontal scaling
- Replication for high availability
- Separate keeper/zookeeper cluster
Monitoring
Implement monitoring for:
- Consumer lag
- Query latency
- ClickHouse performance
- Error rates
Resource Requirements
Production resource recommendations:| Component | CPU | Memory | Disk |
|---|---|---|---|
| API Server | 4+ cores | 8GB+ | 20GB |
| Consumer | 2+ cores | 4GB+ | 20GB |
| ClickHouse | 8+ cores | 32GB+ | SSD, size depends on data retention |
| Kafka | 4+ cores | 8GB+ | 500GB+ |
| Redis | 2+ cores | 4GB+ | 10GB |
Security
Troubleshooting
ClickHouse Connection Timeout
ClickHouse Connection Timeout
Symptoms:
Connection timeout or Connection refused errorsSolutions:- Verify ClickHouse is running:
curl http://localhost:8123/ping - Check ClickHouse logs:
docker logs clickhouse - Ensure correct host/port in configuration
- Check firewall rules
Kafka Consumer Lag
Kafka Consumer Lag
Symptoms: Slow data ingestion, growing consumer lagSolutions:
- Increase consumer replicas
- Reduce batch time
- Check ClickHouse write performance
- Monitor ClickHouse insert rate (should be ~1/sec per shard)
Migration Failures
Migration Failures
Symptoms: Migration commands fail or hangSolutions:
- Check ClickHouse connectivity
- Review migration logs for errors
- Ensure no other migrations are running
- For hung migrations, check ClickHouse for long-running queries
Out of Memory Errors
Out of Memory Errors
Symptoms: Python or ClickHouse OOM errorsSolutions:
- Increase memory allocation
- Reduce batch sizes for consumers
- Limit query complexity and row count
- Configure ClickHouse memory limits
Rust Build Failures
Rust Build Failures
Symptoms:
make install-rs-dev failsSolutions:- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - Update Rust:
rustup update - Install maturin:
pip install maturin - Check for build dependencies
Next Steps
Now that you have Snuba installed:Quickstart Guide
Learn how to execute your first queries and explore Snuba’s features
Configuration Guide
Deep dive into configuring datasets, entities, and query processors
API Reference
Complete reference for the HTTP API and query endpoints
Operations Guide
Best practices for monitoring, scaling, and maintaining Snuba