Rune CLI includes comprehensive Sentry integration for error tracking, performance monitoring, and crash reporting. This guide explains how to set up and use Sentry with Rune.
- Automatic capture of command failures and exceptions
- Detailed error context including command, arguments, and system information
- Stack traces for debugging
- Error grouping and deduplication
- Command execution time tracking
- Performance transactions for key operations
- Slow command detection and alerting
- Resource usage monitoring
- Anonymous user identification for session tracking
- System information (OS, version, architecture)
- Application version and environment context
- Command usage patterns
- Command execution history
- User actions and events
- System state changes
- Debug information trail
- Create a Sentry account at sentry.io
- Create a new project for your Rune CLI
- Copy the DSN from your project settings
- The DSN format is:
https://public_key@sentry.io/project_id
export RUNE_SENTRY_DSN="https://your_public_key@sentry.io/your_project_id"
# Optional: configure OTLP logs endpoint for OpenTelemetry
export RUNE_OTLP_ENDPOINT="http://localhost:4318/v1/logs"Add to your ~/.rune/config.yaml:
integrations:
telemetry:
enabled: true
sentry_dsn: "https://your_public_key@sentry.io/your_project_id"
# Optional OpenTelemetry logs endpoint
otlp_endpoint: "http://localhost:4318/v1/logs"Use the provided example:
cp examples/config-telemetry.yaml ~/.rune/config.yaml
# Edit the file to add your actual DSNSet the environment for better error categorization:
export RUNE_ENV="production" # or "development", "staging"- Error messages and stack traces
- Command that caused the error
- System information (OS, architecture)
- Application version
- Anonymous user ID
- Command execution times
- Success/failure rates
- System resource usage
- Performance bottlenecks
- Anonymous user identifier (hostname-based)
- Operating system and version
- Application version and environment
- Command usage patterns
- Personal information or credentials
- File contents or sensitive data
- Network requests or API keys
- User-specific paths or filenames
- Any personally identifiable information
- User IDs are generated anonymously using hostname and timestamp
- No personal information is transmitted
- All data is aggregated and anonymized
- Sensitive information is filtered out before transmission
export RUNE_TELEMETRY_DISABLED=true
rune start # Telemetry disabled for this sessionAdd to your configuration:
integrations:
telemetry:
enabled: falseOr set environment variable permanently:
echo 'export RUNE_TELEMETRY_DISABLED=true' >> ~/.bashrcSet up alerts in Sentry for:
- Command failures
- Performance degradation
- High error rates
- New error types
Monitor:
- Average command execution time
- Slow commands (>5 seconds)
- Memory usage patterns
- System resource consumption
Create dashboards for:
- Command usage statistics
- Error trends over time
- Performance metrics
- User engagement patterns
export RUNE_ENV="development"
export RUNE_SENTRY_DSN="https://dev_key@sentry.io/dev_project_id"Force an error to test Sentry integration:
# This will trigger error reporting
rune start nonexistent_project_with_invalid_configEnable verbose logging:
rune --verbose statusThe telemetry system provides additional functions for custom error handling:
// In your custom commands
telemetry.CaptureException(err, map[string]string{
"command": "custom_command",
"context": "additional_context",
}, map[string]interface{}{
"extra_data": "value",
})
telemetry.CaptureMessage("Custom message", sentry.LevelWarning, map[string]string{
"category": "custom",
})Track custom operations:
transaction := telemetry.StartTransaction("custom_operation", "operation")
if transaction != nil {
defer transaction.Finish()
// Your operation here
}- Verify DSN format is correct
- Check network connectivity
- Ensure telemetry is enabled
- Verify Sentry project settings
- Telemetry is designed to be lightweight
- Errors are sent asynchronously
- Minimal performance overhead (<1ms per command)
- Automatic rate limiting prevents spam
- All data is anonymized
- No sensitive information is collected
- Easy to disable completely
- Transparent data collection practices
# Check telemetry status
rune config show
# Test with verbose output
rune --verbose start
# Disable temporarily
RUNE_TELEMETRY_DISABLED=true rune startFor issues with Sentry integration:
- Check this documentation
- Verify your Sentry project configuration
- Test with verbose logging enabled
- Create an issue in the Rune repository
- All data transmission uses HTTPS
- No credentials or secrets are transmitted
- Anonymous user identification only
- Compliant with privacy regulations
- Regular security audits of telemetry code
Note: Telemetry helps improve Rune by identifying common issues and usage patterns. All data is collected anonymously and used solely for product improvement.