SentryStr
A decentralized error tracking and alerting system using the Nostr protocol.
Overview
SentryStr provides a Rust library for publishing structured error events and logs to the Nostr network, enabling decentralized monitoring and alerting. It offers a familiar API similar to traditional error tracking services like Sentry, but leverages the censorship-resistant and decentralized nature of Nostr.
Features
- Decentralized Logging: Publish error events to multiple Nostr relays
- Structured Events: Rich event data with levels, timestamps, and custom fields
- Direct Message Alerts: Optional encrypted DM notifications for critical errors
- Multiple Event Types: Support for errors, warnings, info messages, and custom events
- Encryption Support: NIP-44 and NIP-59 encryption for sensitive data
- Flexible Configuration: Easy setup with sensible defaults
Quick Start
Add this to your Cargo.toml
:
[]
= "0.1.0"
Basic usage:
use ;
use Keys;
async
Event Levels
Debug
: Detailed diagnostic informationInfo
: General informational messagesWarning
: Warning messages for potentially harmful situationsError
: Error events that might still allow the application to continueFatal
: Very severe error events that might cause the application to abort
Advanced Usage
Direct Message Alerts
Set up encrypted direct message notifications for critical errors:
use ;
use *;
use *;
async
Custom Event Fields
Add custom fields to your events:
use ;
use json;
let event = new
.with_message
.with_level
.with_field
.with_field
.with_field;
Integration with Other Crates
- sentrystr-tracing: Integration with the
tracing
ecosystem - sentrystr-collector: Event collection and monitoring tools
- sentrystr-api: REST API for querying events
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.