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/SahanPramuditha-Dev/Syslens.git
cd Syslens

# Install core library + CLI
pip install -e .

# Install with the web dashboard (FastAPI + WebSocket)
pip install -e .[dashboard]

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.

0. Single top-level import (recommended)

import syslens

metrics = syslens.get_system_info()
print(f"CPU: {metrics['cpu_usage']}%  |  Memory: {metrics['memory_usage']}%")

score = syslens.calculate_health(metrics)
print(f"Health score: {score:.1f}/100")

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.1.tar.gz (1.1 MB 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.1-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for syslens-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bb47400f4b7c20ef7e9c56b7f289e8bf4fc869005abe02c91a5f597e02ba9aa4
MD5 f3bc6da4b4aabcaae07bbfa1b0e72588
BLAKE2b-256 0769d4db93a38b128cf08364d4ca1e593e3ae2cae62010eb7f8cf9c2593f8bb1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: syslens-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07c3e0f7284254c226eda0fee677d47909999619b3e3a45eb9e05ec037fc06ec
MD5 3792a43558a37d82530b12951cf5465b
BLAKE2b-256 dc13e59a40f46ed620a2b592286cb4b114961583324f65692d376946eb5faad8

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