π telemetry-kit
Privacy-first, batteries-included telemetry for Rust applications
telemetry-kit makes adding OpenTelemetry to your Rust applications effortless. No more 50+ lines of boilerplate, no more wondering what to instrument, no more privacy concerns.
π― The Problem
Current Rust telemetry solutions are:
- Too complex: Setting up OpenTelemetry requires understanding multiple crates and writing verbose boilerplate
- Not opinionated: Developers don't know what to track or where to add instrumentation
- Privacy-blind: Easy to accidentally log PII, no built-in anonymization
- CLI-unfriendly: Most tools designed for long-running services, not CLI applications
- Hard to self-host: Commercial solutions or complex infrastructure required
β¨ The Solution
use *;
// π That's it!
async
What you get:
- β 3 lines instead of 50+: Sensible defaults, zero boilerplate
- π― Smart instrumentation: Auto-detect CLI commands, errors, and performance bottlenecks
- π Privacy-first: Built-in anonymization, GDPR-compliant, opt-in by default
- π CLI-optimized: Works with short-lived processes, offline-capable
- π¦ Self-hostable: Simple Docker-based collection server included
- π€ AI-suggested: Get recommendations on what to instrument
π Key Features
Zero-Config Telemetry
// Literally one line
init.auto_configure?;
Privacy Controls
init
.anonymous // Anonymous user IDs
.sanitize_emails // Hash email addresses
.exclude_env_vars // Don't capture environment
.gdpr_compliant // Full GDPR compliance
.consent_prompt // Ask user on first run
.init;
Smart Instrumentation
// Auto-track duration & errors
async
CLI-Specific Features
use *;
// Automatically tracks:
// - Which commands are used
// - Command duration
// - Success/failure rates
// - Anonymous usage patterns
πΊοΈ Roadmap
Phase 1: Foundation (v0.1.0) - Q1 2025
- Core telemetry abstraction over OpenTelemetry
- Privacy-first defaults (anonymization, sanitization)
- Basic instrumentation macros
- Simple OTLP export
- Documentation and examples
Phase 2: Developer Experience (v0.2.0) - Q2 2025
- CLI scaffolding tool (
telemetry-kit init) - Auto-detection of instrumentation points
- Smart suggestions (analyze code, suggest where to add tracking)
- Pre-built configuration templates
- VS Code extension for inline suggestions
Phase 3: CLI Optimization (v0.3.0) - Q2 2025
- Short-lived process handling
- Offline caching with automatic sync
- User consent flow (first-run prompts)
- Minimal overhead (<1ms impact)
- Graceful degradation when server unavailable
Phase 4: Self-Hosting (v0.4.0) - Q3 2025
- Simple collection server (Docker one-liner)
- Built-in dashboard for basic analytics
- SQLite/PostgreSQL storage backends
- REST API for custom integrations
- Pre-built dashboards for common patterns
Phase 5: Advanced Features (v0.5.0+) - Q4 2025
- AI-powered insights (usage patterns, anomaly detection)
- Anonymous user cohorts
- A/B testing support
- Feature flag integration
- Custom metric definitions
- Multi-project dashboards
π Comparison with Existing Solutions
| Feature | telemetry-kit | OpenTelemetry | tracing | sentry-rust |
|---|---|---|---|---|
| Setup Complexity | β Low (3 lines) | β οΈ High (50+ lines) | β οΈ Medium | β Low |
| Privacy Built-in | β Yes | β No | β No | β οΈ Partial |
| CLI Optimized | β Yes | β No | β No | β οΈ Partial |
| Auto-instrumentation | β Yes | β No | β No | β οΈ Errors only |
| Self-hostable | β Included | β οΈ Complex | N/A | β Commercial |
| Smart Suggestions | β Yes | β No | β No | β No |
| Offline Support | β Yes | β No | N/A | β οΈ Limited |
| GDPR Compliant | β Built-in | β οΈ Manual | β οΈ Manual | β οΈ Manual |
π Quick Start
Installation
[]
= "0.0.1"
Basic Usage
use *;
async
async
CLI Application
use Parser;
use *;
// Auto-track all commands!
async
ποΈ Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Macros β β Middleware β β Manual β β
β β #[instrument]β β Tracking β β Tracking β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β ββββββββββββββββββββ΄βββββββββββββββββββ β
βββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β
ββββββββββββΌβββββββββββ
β telemetry-kit Core β
β β
β β’ Privacy filters β
β β’ Anonymization β
β β’ Batching β
β β’ Sampling β
ββββββββββββ¬βββββββββββ
β
βββββββββββββββββββββββΌββββββββββββββββββββββ
β β β
βββββββββΌβββββββββ βββββββββββΌβββββββββ ββββββββββΌβββββββββ
β OpenTelemetry β β Simple Server β β Custom β
β (OTLP) β β (Self-hosted) β β Backends β
ββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
π Privacy & Compliance
telemetry-kit is privacy-first by design:
- Anonymous by default: No PII collected unless explicitly enabled
- User consent: Built-in consent flow for CLI applications
- Data sanitization: Automatic scrubbing of sensitive data
- GDPR compliant: Right to erasure, data portability, consent management
- Transparent: Users can see exactly what data is collected
- Opt-out friendly: Easy to disable, respects DO_NOT_TRACK
Privacy Features
init
.privacy
.init;
π€ Contributing
We welcome contributions! This is a new project and we're building it in the open.
How to Contribute
- Check out our Roadmap for planned features
- Look at GitHub Issues for tasks
- Read CONTRIBUTING.md for guidelines
- Join discussions in GitHub Discussions
Areas We Need Help
- π¨ Design: API design, ergonomics, developer experience
- π Documentation: Examples, tutorials, guides
- π§ Implementation: Core features, integrations, tools
- π§ͺ Testing: Unit tests, integration tests, real-world usage
- π Community: Blog posts, talks, spreading the word
π Documentation
- Quick Start Guide (coming soon)
- API Reference
- Privacy Guide (coming soon)
- CLI Best Practices (coming soon)
- Self-Hosting Guide (coming soon)
π‘ Inspiration
This project is inspired by:
- The simplicity of sentry-rust
- The power of OpenTelemetry
- The ergonomics of tracing
- The privacy-focus of Plausible Analytics
- The developer experience of Next.js Analytics
π License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
π Acknowledgments
Built with β€οΈ by Ibrahim Cesar and contributors.
Special thanks to:
- The OpenTelemetry project
- The Rust tracing ecosystem
- Everyone who provided feedback and ideas
Status: π§ Early Development - API is unstable and will change
Current Version: 0.0.1 - Placeholder release for crate reservation
First Usable Release: v0.1.0 (Target: Q1 2025)
β Star us on GitHub | π Read the Docs | π¬ Discussions