Quick Start Guide
Get telemetry-kit integrated into your Rust application in 5 minutes
5-Minute Integration for OSS Projects
Add privacy-first usage analytics to your Rust CLI tool, library, or application. Perfect for open source maintainers who want to understand real-world usage without compromising user privacy.
Prerequisites: Rust 1.70+ and Cargo installed
For OSS Maintainers: This guide shows you how to add transparent, privacy-respecting telemetry that your users will trust.
Add Dependency
Add telemetry-kit to your Cargo.toml:
Feature flags:
privacy- GDPR-compliant privacy controls (recommended)sync- Auto-sync to backend server (optional)cli- CLI tools and interactive prompts (optional)
Test It
Run your application:
Your events are now stored locally in ~/.telemetry-kit/events.db. You can verify:
Add Privacy (Optional but Recommended)
Use strict privacy mode for GDPR compliance:
Or prompt users for consent:
To collect and analyze telemetry data from your users, you need a backend server to receive events. You have two options:
-
Managed Service (Recommended) - Use our hosted service at telemetry-kit.dev. Get started instantly with a dashboard, analytics, and zero infrastructure to maintain.
-
Self-Hosted - Deploy your own telemetry server using our production-ready server implementation. Full control over your data, but requires infrastructure management.
Without a server configured, events are stored locally on each user's machine in ~/.telemetry-kit/.
What You Get
After completing this quick start, you have:
- ✅ Local event storage - All events stored in SQLite
- ✅ Privacy-first - Respects DO_NOT_TRACK by default
- ✅ Automatic sanitization - Paths and emails are sanitized
- ✅ Offline-first - Works without network connectivity
- ✅ Type-safe API - Compile-time safety with Rust
Next Steps
Privacy Controls
Learn about GDPR compliance, consent management, and data sanitization
Auto-Sync
Set up automatic syncing to your backend server
Best Practices
Patterns for CLI apps, libraries, and web services
API Reference
Complete API documentation
Common Issues
Events Not Appearing
Problem: Events aren't showing up in the database.
Solutions:
- Check if
DO_NOT_TRACK=1is set:echo $DO_NOT_TRACK - Verify consent wasn't denied:
telemetry-kit consent status - Ensure you're calling
.await?on tracking methods - Call
telemetry.shutdown().await?to flush events
Build Errors
Problem: Compilation fails with feature errors.
Solution: Ensure you have the required features enabled:
Permission Denied
Problem: Can't write to database.
Solution: Check permissions on ~/.telemetry-kit/:
Complete Example
Here's a complete, copy-paste example:
Need Help?
- Documentation - Full documentation
- Examples - Example projects
- GitHub Issues - Report bugs
- API Reference - Complete API docs
Time to integrate: ~5 minutes Lines of code: ~15 Privacy: Built-in, GDPR-compliant