| Crates.io | oculus |
| lib.rs | oculus |
| version | 0.1.3 |
| created_at | 2025-12-11 16:31:00.147996+00 |
| updated_at | 2025-12-17 06:53:08.210209+00 |
| description | Unified telemetry system for monitoring and observability |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1980049 |
| size | 445,887 |
Value Monitoring • Single Binary • Zero Dependencies
Oculus is an out-of-the-box value monitoring software designed for individuals and small teams. Written in Rust, single binary, zero external dependencies.
- ⚠️ Status: v0.1.3 - Under active development
- 🛑 Scope Note: v0.1.x is single-user; no user/account/role management.
📖 See PRD for detailed functional requirements.
| Category | Examples | Description |
|---|---|---|
| Cryptocurrency | BTC, ETH | Asset prices from exchanges |
| Stock Market | TSLA, GOOGL, SPY, QQQ | Stock and index prices |
| Prediction Markets | Polymarket | Event contract prices and odds |
| Market Indicators | Fear Index, S&P Multiples, Altcoin Index | Sentiment and valuation metrics |
| Network Metrics | HTTP, TCP, Ping | Response time, status codes, latency |
| Custom Values | RESTful API | Any numeric value via generic collector |
Collectors → MPSC Channel → SQLite/PostgreSQL → Rule Engine → Notifications/Actions
│ │ │ │
├─ Crypto Prices └─ Single ├─ Simple Rules ├─ Log
├─ Stock Prices Writer (YAML/TOML) ├─ Email
├─ Prediction Markets ├─ Complex Rules ├─ Telegram
├─ Market Indicators (Raw SQL) ├─ Discord
├─ Network Probes (HTTP/TCP/Ping) ├─ Slack
└─ Generic API Collector ├─ Webhook
└─ HTTP POST Action
📖 See PRD for detailed logical architecture and component overview.
| Layer | Technology | Purpose |
|---|---|---|
| Language | Rust 2024 | Memory safety, zero GC pause |
| Async Runtime | Tokio | High-concurrency I/O |
| Web Framework | Axum | Lightweight, Tokio-native |
| Database | SQLite | Embedded database, single file |
| Frontend | HTMX | AJAX via HTML attributes |
| Templating | Askama | Type-safe, compiled templates |
| Styling | Tailwind CSS | Bundled, offline-first |
# Clone the repository
git clone https://github.com/telepair/oculus.git
cd oculus
# Build full distribution (CSS + release binary)
make release
# Run with default config
./target/release/oculus
# Run with custom options
./target/release/oculus --config configs/config.yaml --server-port 9090
📖 See Getting Started for detailed configuration options.
# Full CI pipeline: format → lint → check → test → build
make all
# Individual commands
make fmt # Format code
make lint # Run clippy + markdownlint
make test # Run tests
make doc-open # Build and view documentation
Oculus uses a YAML configuration file for server, database, and collectors:
# Example: configs/config.yaml
server:
bind: 0.0.0.0
port: 8080
database:
driver: sqlite
dsn: data/oculus.db
channel_capacity: 10000
collectors:
tcp:
- name: google-dns
host: 8.8.8.8
port: 53
enabled: true
group: production
interval: 5s
timeout: 5s
tags:
env: production
ping:
- name: cloudflare-ping
host: 1.1.1.1
enabled: true
group: production
interval: 30s
timeout: 3s
http:
- name: api-health
url: https://api.example.com/health
enabled: true
group: production
method: GET
expected_status: 200
interval: 30s
timeout: 10s
headers:
Authorization: "Bearer ${API_TOKEN:-default}"
success_conditions:
status_codes: [200, 201]
body_jsonpath: "$.status"
📖 See
configs/config.example.yamlfor complete configuration options.
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Dashboard homepage |
/api/metrics |
GET | List metrics with filters |
/api/metrics/stats |
GET | Get aggregated metric stats |
/api/events |
GET | List events with filters |
/api/collectors |
GET | List configured collectors |
/api/query |
POST | Execute read-only SQL query |
/healthz |
GET | Health check (process up) |
/readyz |
GET | Readiness check (DB ready) |
oculus/
├── src/
│ ├── lib.rs # Library: shared core functionality
│ └── main.rs # Binary: runs complete system
├── templates/ # Askama templates (compiled into binary)
│ ├── dashboard.html
│ └── static/css/
├── configs/ # Configuration examples
├── docs/
│ ├── PRD.md # Product Requirements Document
│ ├── getting-started.md # Build & Run Guide
│ ├── lib.md # Library Integration Guide
│ └── schema.md # Database Schema Reference
├── Cargo.toml # Rust dependencies
├── Makefile # Build automation
└── LICENSE # MIT License
| Target | Path | Purpose |
|---|---|---|
lib |
src/lib.rs |
Exports reusable modules (collector, storage, rule engine, etc.) |
bin |
src/main.rs |
Entry point for running the complete Oculus system |
Use as a library:
use oculus::{Collector, Storage, RuleEngine};
Run as a binary:
cargo run --bin oculus
| Metric | Target |
|---|---|
| Startup Time | < 100ms |
| Memory (Idle) | < 50MB |
| Binary Size | < 20MB |
v0.1.3 milestone tasks based on PRD
metrics table schema and migrationsevents table for alerts/auditcollectors table for collector configurationGET /)GET /api/metrics)GET /api/events)GET /api/metrics/stats)POST /api/query)tracing crate/healthz, /readyz)Contributions are welcome! Please read the PRD in docs/PRD.md for architectural context before submitting changes.
git checkout -b feat/amazing-feature)git commit -s -m 'feat: add amazing feature')git push origin feat/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Oculus - Monitor any value, miss nothing.