Skip to main content

A lightweight observability, diagnostics, and anomaly detection platform for developer environments

Project description

🧠 SysLens

SysLens is a lightweight, local-first system telemetry intelligence and observability platform designed for developers. It combines low-overhead metrics collection with a behavioral anomaly engine, actionable troubleshooting diagnostics, a modular plugin system, and dual frontend options (a dark-glass web dashboard and a premium terminal interface).

License: MIT Python Version


✨ Features

  • 📊 Comprehensive Telemetry: Real-time tracking of CPU utilization, logical core frequencies, virtual memory state, disk partition IO, system uptime, and top resource-hogging processes.
  • 📈 Rolling Behavioral Baselines: Learns system behavior patterns dynamically. Calculates rolling means and standard deviations locally to detect subtle deviations without external DBs.
  • ⚠ Z-Score Anomaly Engine: Identifies CPU, memory, and disk IO spikes, categorizes severity (LOW, MEDIUM, HIGH), and detects correlated bottlenecks (e.g. concurrent CPU and RAM stress).
  • 🔌 Extensible Plugins: Supports built-in plugins for Battery Health and GPU utilization, with runtime loading for custom external scripts.
  • 🖥️ Premium CLI Toolkit:
    • syslens scan - Side-by-side terminal dashboard pane.
    • syslens health - Quick diagnostic checklist and score (0-100).
    • syslens live - Real-time btop-inspired terminal stream.
  • glassmorphic Web UI: Stunning dark-glass design running on a FastAPI + WebSocket backend with live Chart.js animations.

🚀 Quick Start

Installation

Install dependencies and run SysLens in editable mode:

# Clone the repository
git clone https://github.com/your-username/syslens.git
cd syslens

# Install requirements and CLI package
pip install -r requirements.txt
pip install -e .

CLI Command Reference

SysLens packages itself into two console command scripts (syslens and syslensd):

Command Action
syslens scan Fetch a structured, double-column telemetry summary.
syslens scan --json Output system snapshot as a clean JSON structure.
syslens health Execute diagnostics, check anomalies, and view recommendations.
syslens live Run the real-time split-pane terminal dashboard stream.
syslens serve / syslensd Launch the FastAPI local server (default: http://127.0.0.1:8000).
syslens export Export the current snapshot to a glassmorphism HTML report.

🎨 Terminal Preview

syslens scan

--------------------- SYSLENS - ENTERPRISE TELEMETRY SCAN ---------------------

+------- ENVIRONMENT METADATA -------+  +--------- SYSTEM HEALTH KPI ---------+
|   * OS Platform : Windows 11       |  |                                     |
| (AMD64)                            |  |   Overall Rating : DEGRADED         |
|   * Hostname    : Dev-Station      |  |   Health Score   : 64.3 / 100       |
|   * Local IP    : 192.168.1.6      |  |   Status Gauge   :                  |
|   * Uptime      : 1h 42m 2s        |  | ##############-------- 64.3%        |
+------------------------------------+  +-------------------------------------+

+------- TELEMETRY STATISTICS -------+  +--------- TOP PROCESS HOGS ----------+
|  Resource   Meter       Details    |  |  PID    Name   CPU %      %  Status |
|  CPU        ##-------   16 Cores   |  |  7820   Code   0.0%  2.92%  running |
|             16.1%       @ 2400MHz  |  |  22448  Code   0.0%  2.88%  running |
|  Memory     #########   11.25 GB   |  |  13084  chrome 0.0%  2.78%  running |
+------------------------------------+  +-------------------------------------+

📦 Developer SDK Usage

SysLens can be directly embedded into your Python application or backend script.

1. Library Telemetry Snapshot

from syslens.core.system import get_system_info
from syslens.core.health import calculate_health

# Fetch raw metrics dict
metrics = get_system_info()
print(f"CPU usage: {metrics['cpu_usage']}%, Memory usage: {metrics['memory_usage']}%")

# Generate Health Score
score = calculate_health(metrics)
print(f"System Health Rating: {score}/100")

2. Runtime Anomaly Detection

from syslens.engine.detector import AnomalyDetector

detector = AnomalyDetector()

# Periodic tick checks (returns any deviations matching the rolling baseline)
anomalies = detector.tick()
if anomalies:
    for anomaly in anomalies:
         print(f"[{anomaly['severity']}] {anomaly['metric']}: {anomaly['description']}")

🛠️ Repository Navigation

To learn more about SysLens, read the comprehensive guides in the repository:

  • ARCHITECTURE.md: Explore the data flow, Mermaid architecture diagrams, and baseline Z-score formulas.
  • TESTING.md: Guidelines for running pytest, mocking hardware info, and reviewing code coverage.
  • CONTRIBUTING.md: How to submit bug reports, pull requests, and code extensions.
  • ROADMAP.md: Development milestones and future goals.
  • CHANGELOG.md: Detailed version history and release notes.

📜 License

Distributed under the MIT License. See LICENSE for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syslens-1.0.0.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syslens-1.0.0-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

Details for the file syslens-1.0.0.tar.gz.

File metadata

  • Download URL: syslens-1.0.0.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for syslens-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2bef54984ca7072f16a85a59152b3b617c189ccc4d49f7cfa8d3ca6d2b05c643
MD5 313b5bb8317d14f1026f5d9ff2607e10
BLAKE2b-256 5d70c693f46e81299f3a9eef86f4805f5ea347478bdd43f34a1335d796c96209

See more details on using hashes here.

File details

Details for the file syslens-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: syslens-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 38.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for syslens-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b8ef311603b4deabae2b156fa24cd8d70842ce4c9eab9f845a0daf601b584af
MD5 322ff496da67cda4a32844baa9993517
BLAKE2b-256 acf013a7891d12a43c6852f060b4218a3bea7a601a1309b4374f5a204872f82a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page