README
ΒΆ
SysMetrics
A powerful, interactive terminal-based system monitoring tool built in Go that provides real-time system metrics visualization and flexible logging capabilities.
Features
Real-time System Monitoring
- CPU Usage: Per-core and overall CPU utilization with visual progress bars
- Memory Information: RAM usage, available memory, and detailed statistics
- Disk Usage: Storage utilization across all mounted drives
- Network Statistics: Network interface statistics and throughput
- Host Information: System details including OS, platform, and uptime
Interactive Terminal UI
- Bubble Tea Framework: Smooth, responsive terminal user interface
- Multiple View Modes: Switch between monitoring, streaming, and management modes
- Keyboard Navigation: Intuitive controls with arrow keys and shortcuts
- Real-time Updates: Configurable refresh intervals (default 2 seconds)
- Search Functionality: Filter and search through metrics
Data Streaming & Logging
- Multiple Output Formats: Support for 11+ industry-standard log formats
- OpenTelemetry (JSON)
- OTLP Text Line Protocol
- Prometheus
- JSON Lines
- InfluxDB Line Protocol
- AWS CloudWatch
- CSV/TSV
- XML/YAML
- Syslog (RFC 5424)
- Flexible Intervals: Stream data per minute, hourly, or daily
- Background Processing: Run multiple streaming processes simultaneously
Background Process Management
- Independent Processes: Spawn and manage background streaming processes
- Process Lifecycle: Start, stop, list, and delete background processes
- Real-time Status: Monitor process health and statistics
- Graceful Shutdown: Clean termination with summary logging
- Concurrent Operations: Multiple processes can run simultaneously
Log Management
- Automatic Directory Creation: Creates log directories as needed
- Format-specific Files: Appropriate file extensions for each format
- Process Summaries: Detailed logs of process lifecycle events
- Configurable Paths: Custom log directory locations
Quick Start
Installation
SysMetrics can be installed in multiple ways. Choose the method that best suits your needs:
Option 1: One-Line Install (Easiest)
Install the latest version with a single command:
curl -fsSL https://raw.githubusercontent.com/razpinator/sysmetrics/master/install.sh | bash
Or with wget:
wget -qO- https://raw.githubusercontent.com/razpinator/sysmetrics/master/install.sh | bash
This script automatically detects your platform and installs the appropriate binary to /usr/local/bin.
Option 2: Go Install (Recommended for Go Users)
If you have Go installed, you can install SysMetrics directly:
go install github.com/razpinator/sysmetrics@latest
This installs the latest version to your $GOPATH/bin directory. Make sure this directory is in your PATH.
Option 3: Download Pre-built Binaries
Download the latest release for your platform from the GitHub Releases page:
- macOS (Intel):
sysmetrics-darwin-amd64 - macOS (Apple Silicon):
sysmetrics-darwin-arm64 - Linux (x86_64):
sysmetrics-linux-amd64 - Windows (x64):
sysmetrics-windows-amd64.exe
After downloading, make the binary executable and move it to your PATH:
# macOS/Linux
chmod +x sysmetrics-*
sudo mv sysmetrics-* /usr/local/bin/sysmetrics
# Windows
# Move the .exe file to a directory in your PATH
Option 4: Build from Source
Prerequisites
- Go 1.25.1 or later
- Git
- Make (optional, for easier building)
Quick Build
git clone https://github.com/razpinator/sysmetrics.git
cd sysmetrics
go build -o sysmetrics .
./sysmetrics
Using Make (Recommended for Development)
git clone https://github.com/razpinator/sysmetrics.git
cd sysmetrics
# Build the binary
make build
# Install to /usr/local/bin (requires sudo)
make install
# Or just run directly
make run
Available Make Targets
make build- Build the binarymake install- Install to system PATHmake uninstall- Remove from system PATHmake test- Run testsmake clean- Clean build artifactsmake cross-compile- Build for multiple platformsmake help- Show all available targets
Option 5: Package Managers
Homebrew (macOS)
# Coming soon
brew install razpinator/tap/sysmetrics
Arch Linux (AUR)
# Coming soon
yay -S sysmetrics
Verification
After installation, verify SysMetrics is working:
sysmetrics --version
sysmetrics --help
CLI Usage
Basic Commands
# Run SysMetrics (interactive mode)
sysmetrics
# Show version information
sysmetrics --version
sysmetrics -v
# Show help information
sysmetrics --help
sysmetrics -h
Interactive Mode
Once you run sysmetrics, you'll enter the interactive terminal interface:
- Launch the application and you'll see the main menu
- Navigate using arrow keys (β/β)
- Select a metric type to monitor (CPU, Memory, Disk, Network, Host, or All)
- Press Enter to start real-time monitoring
- Press 'q' to return to the main menu or exit
Command Line Options
| Flag | Description |
|---|---|
--version |
Display version, commit, and build information |
--help |
Show detailed help information and usage |
Quick Start
Simply run the following command to start monitoring your system:
sysmetrics
The application will open in interactive mode with an intuitive menu system.
π Detailed Usage
Main Menu Options
- π All Metrics: Monitor all system metrics simultaneously
- π₯ CPU Usage: Detailed CPU monitoring with per-core breakdown
- πΎ Memory Info: RAM usage and memory statistics
- πΏ Disk Usage: Storage utilization across drives
- π Network Stats: Network interface statistics
- βΉοΈ Host Info: System information and details
- π Stream to Logs: Configure and start log streaming
- π§ Manage Background Processes: Control background streaming processes
Keyboard Controls
Main Menu
- β/β: Navigate menu options
- Enter: Select option
- / or s: Search metrics
- q: Quit application
Monitoring Mode
- b: Back to main menu
- β/β: Change update interval
- q: Quit to main menu
Background Process Management
- n: Start new background process
- s: Stop selected process
- d: Delete stopped process
- a: Stop all processes
- β/β: Navigate process list
- b: Back to previous menu
Stream Configuration
- β/β: Navigate options
- Enter: Confirm selection
- b: Back to previous menu
Setting Up Log Streaming
- From main menu, select "π Stream to Logs"
- Choose format from the available options
- Select interval (Per Minute, Hourly, Daily)
- Streaming starts automatically with visual feedback
- Log files are created in
./logs/directory
Managing Background Processes
- Select "π§ Manage Background Processes" from main menu
- Press 'n' to create a new background process
- Configure format and interval for the new process
- Monitor process status in real-time
- Use 's' to stop or 'd' to delete' stopped processes
Project Structure
sysmetrics/
βββ main.go # Application entry point
βββ go.mod # Go module dependencies
βββ internal/ # Internal packages
β βββ logging/ # Background streaming and log formatting
β βββ metrics/ # System metrics collection
β βββ model/ # Bubble Tea application model
β βββ types/ # Type definitions and constants
β βββ ui/ # UI styles and views
β βββ utils/ # Utility functions
βββ logs/ # Generated log files (created at runtime)
Configuration
Environment Variables
The application uses sensible defaults but can be configured through the UI:
- Update Interval: Configurable from 1-10 seconds
- Log Directory: Default
./logs/(automatically created) - Stream Intervals: Per minute, hourly, or daily
- Log Formats: 11 supported formats
Supported Log Formats
| Format | Description | File Extension |
|---|---|---|
| OpenTelemetry (JSON) | OTEL-compliant JSON format | .json |
| OTLP Text Line | OpenTelemetry Protocol text | .otlp |
| Prometheus | Prometheus metrics format | .prom |
| JSON Lines | Newline-delimited JSON | .jsonl |
| InfluxDB Line Protocol | Time-series database format | .influx |
| AWS CloudWatch | CloudWatch Logs format | .cw |
| CSV | Comma-separated values | .csv |
| TSV | Tab-separated values | .tsv |
| XML | Structured XML format | .xml |
| YAML | Human-readable YAML | .yml |
| Syslog (RFC 5424) | Standard syslog format | .syslog |
Dependencies
Core Dependencies
- Bubble Tea: Terminal UI framework
- Bubbles: UI components for Bubble Tea
- Lipgloss: Style definitions for terminal UIs
- gopsutil: Cross-platform system metrics library
- yaml.v3: YAML processing library
Automatic Dependencies
All transitive dependencies are automatically managed by Go modules.
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is open source. Please check the license file for details.
Troubleshooting
Common Issues
Application won't start:
- Ensure Go 1.25.1+ is installed
- Run
go mod downloadto install dependencies - Check terminal compatibility (colors and alternate screen)
Metrics not updating:
- Verify system permissions for reading system metrics
- Check if gopsutil is compatible with your OS
- Try running with elevated privileges if needed
Background processes not working:
- Ensure write permissions to the log directory
- Check available disk space
- Verify no conflicting processes are using the same files
Log files not created:
- Check write permissions in the current directory
- Ensure sufficient disk space
- Verify the log path is accessible
Getting Help
- Check existing issues in the repository
- Review the documentation
- Create a detailed issue with system information and error messages
Version History
See the commit history for detailed changes and improvements.
SysMetrics - Making system monitoring intuitive and powerful! π
Documentation
ΒΆ
There is no documentation for this package.