Skip to content

Captain-Sangam/PulseBar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

PulseBar Icon

PulseBar - RDS Monitor

A macOS menu bar app for monitoring AWS RDS instances with real-time health metrics and alerts.

macOS Swift License

PulseBar Screenshot

Features

  • πŸ“Š Real-time Monitoring: Track CPU, connections, storage, and activity for all RDS instances
  • ⚑ Auto-refresh: Updates every 15 minutes automatically
  • πŸ”” Smart Alerts: macOS notifications when metrics exceed 50% (with deduplication)
  • 🎨 Color-coded Status: Green (<50%), Yellow (50-75%), Red (>75%)
  • πŸ” AWS Integration: Uses your existing ~/.aws/credentials and ~/.aws/config
  • 🌍 Multi-region/Profile: Switch between AWS profiles and regions easily

Metrics Tracked

For each RDS instance:

Metric Source Description
CPU Utilization CloudWatch CPUUtilization Current CPU usage percentage
Connections Used DatabaseConnections / max_connections Γ— 100 Percentage of connection pool used
Storage Used (AllocatedStorage - FreeStorageSpace) / AllocatedStorage Γ— 100 Percentage of disk space used
Activity CloudWatch DatabaseConnections Current number of database connections

Requirements

  • macOS 13.0 or later
  • Swift 5.9+
  • AWS credentials configured at ~/.aws/credentials
  • IAM permissions:
    • rds:DescribeDBInstances
    • cloudwatch:GetMetricData

Installation

Option 1: Download Pre-built Release

  1. Go to the Releases page
  2. Download the latest PulseBar-vX.X.X-macOS.zip
  3. Unzip and move to Applications:
    unzip PulseBar-vX.X.X-macOS.zip
    mv PulseBar.app /Applications/
  4. First launch (app is unsigned, so macOS will block it):
    • Right-click PulseBar.app β†’ Open β†’ Click Open in the dialog
    • Or run: xattr -cr /Applications/PulseBar.app

Option 2: Build from Source

# Clone the repository
git clone <repository-url>
cd PulseBar

# Build and install to /Applications
make install

Option 3: Build and Run Locally

# Run in debug mode
make run

# Or build release binary
make build

Note: When running via make run (without app bundle), macOS notifications are disabled. Use make install for full functionality.

AWS Credentials Setup

Ensure you have AWS credentials configured:

# ~/.aws/credentials
[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY

[production]
aws_access_key_id = PROD_ACCESS_KEY
aws_secret_access_key = PROD_SECRET_KEY
# ~/.aws/config
[default]
region = us-west-2

[profile production]
region = us-east-1

Required IAM Permissions

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": [
      "rds:DescribeDBInstances",
      "cloudwatch:GetMetricData"
    ],
    "Resource": "*"
  }]
}

Usage

  1. Launch PulseBar from Applications or run make run
  2. Click the πŸ“Š icon in your menu bar
  3. Select your AWS profile and region
  4. View real-time metrics for all RDS instances
  5. Click on any instance to see detailed metrics

Menu Options

  • Profile Selector: Switch between AWS profiles
  • Region Selector: Change AWS region (us-east-1, us-west-2, eu-west-1, etc.)
  • Refresh Now: Manual refresh (⌘R)
  • Instance List: Click any instance for details
  • Quit: Exit the application (⌘Q)

Understanding the Display

🟒 my-database-prod          # Green = all metrics healthy (<50%)
   postgres - db.r5.large    # Engine and instance class
   🟒 CPU: 12.5%             # CPU utilization
   🟒 Connections: 23.1%     # Connection pool usage
   πŸ”΄ Storage: 78.2%         # Storage used (red = >75%)
   Activity: 14 connections  # Raw connection count

Color Coding:

  • 🟒 Green: < 50% (healthy)
  • 🟑 Yellow: 50-75% (warning)
  • πŸ”΄ Red: > 75% (critical)
  • βšͺ Gray: N/A (data unavailable)

Status Messages:

  • ⏳ Loading... - Fetching data from AWS
  • ⚠️ AWS credentials not found - Missing ~/.aws/credentials file
  • πŸ” Invalid credentials - Credentials expired or invalid
  • πŸ“­ No RDS instances found - No databases in the selected region

Alert Behavior

Notifications are sent when any metric exceeds 50%:

  • Alerts are deduplicated (won't spam for the same condition)
  • New notifications sent if:
    • Different metrics breach thresholds
    • Instance recovers and breaches again
    • 15+ minutes since last alert for same condition

Example notification:

⚠️ RDS Alert: production-db
CPU: 72%
Connections: 61%

Note: Notifications only work when running as an installed app bundle (make install), not via swift run.

Architecture

Timer (15 min)
   ↓
Load AWS Profile/Credentials
   ↓
DescribeDBInstances (RDS API)
   ↓
GetMetricData (CloudWatch API) - 1 hour window
   ↓
Metric Calculations
   ↓
UI Update + Alert Engine
   ↓
macOS Notification Center

Project Structure

PulseBar/
β”œβ”€β”€ Sources/
β”‚   β”œβ”€β”€ main.swift                    # App entry point
β”‚   β”œβ”€β”€ AppDelegate.swift             # Menu bar UI & coordination
β”‚   β”œβ”€β”€ AWSCredentialsReader.swift    # Reads ~/.aws files
β”‚   β”œβ”€β”€ RDSMonitoringService.swift    # AWS SDK integration
β”‚   β”œβ”€β”€ AlertManager.swift            # Notification logic
β”‚   └── Models.swift                  # Data structures
β”œβ”€β”€ Assets/
β”‚   └── screenshot.png                # App screenshot
β”œβ”€β”€ icons/
β”‚   └── *.png                         # App icons (16-1024px)
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ PULL_REQUEST_TEMPLATE.md      # PR template
β”‚   └── workflows/
β”‚       β”œβ”€β”€ pr-validation.yml         # PR build checks
β”‚       └── release.yml               # Auto-build on release
β”œβ”€β”€ Package.swift                     # Swift Package Manager config
β”œβ”€β”€ Info.plist                        # App metadata
β”œβ”€β”€ Makefile                          # Build commands
β”œβ”€β”€ README.md                         # This file
β”œβ”€β”€ CONTRIBUTING.md                   # Contribution guidelines
β”œβ”€β”€ CODE_OF_CONDUCT.md                # Community standards
β”œβ”€β”€ SECURITY.md                       # Security policy
β”œβ”€β”€ LICENSE                           # MIT License
└── agents.md                         # Developer/AI agent guide

Development

Build Commands

make run      # Debug build and run
make build    # Release build (.build/release/PulseBar)
make clean    # Clean build artifacts
make install  # Install to /Applications
make help     # Show all commands

Dependencies

  • aws-sdk-swift v0.40.0+ (AWSRDS, AWSCloudWatch)

Dependencies are managed via Swift Package Manager and will be automatically resolved on build.

CI/CD

This project uses GitHub Actions for:

  • PR Validation: Builds and validates code on every pull request
  • Release Build: Automatically builds and attaches binaries when a GitHub release is published

See .github/workflows/ for details.

Limitations (v1)

  • No historical graphs or trends
  • Basic max_connections estimation (not querying parameter groups)
  • No Performance Insights integration
  • Single account only (no multi-account aggregation)
  • Read-only monitoring (cannot modify RDS instances)
  • Notifications require app bundle (not available via swift run)

Troubleshooting

"App is damaged" or "Can't be opened"

The app is unsigned, so macOS Gatekeeper blocks it. Fix with one of these:

Option 1: Right-click the app β†’ Open β†’ Click Open in the dialog

Option 2: Run in terminal:

xattr -cr /Applications/PulseBar.app

"AWS credentials not found"

The app can't find ~/.aws/credentials. Set up AWS credentials:

# Option 1: Use AWS CLI
aws configure

# Option 2: Create manually
mkdir -p ~/.aws
cat > ~/.aws/credentials << EOF
[default]
aws_access_key_id = YOUR_KEY
aws_secret_access_key = YOUR_SECRET
EOF

"Invalid credentials" / "Profile not found"

  • Verify the selected profile exists in ~/.aws/credentials
  • If using temporary credentials (SSO, assumed role), refresh them
  • Check credentials haven't expired

"Permission denied"

Verify your IAM user/role has these permissions:

  • rds:DescribeDBInstances
  • cloudwatch:GetMetricData

Storage shows "N/A"

CloudWatch may not have recent data. The app queries a 1-hour window; if no data exists, it shows N/A.

Notifications not appearing

  1. Ensure you're running the installed app (/Applications/PulseBar.app), not swift run
  2. Check System Settings β†’ Notifications β†’ PulseBar
  3. Ensure notifications are enabled
  4. Restart the app if needed

High CPU/memory usage during first run

The first build downloads and compiles AWS SDK dependencies (~200 MB). Subsequent runs will be fast.

License

MIT License - See LICENSE file for details

Contributing

Contributions welcome! Please read our Contributing Guidelines before getting started.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

For architecture and technical details, see agents.md.

Roadmap

  • Parameter group querying for accurate max_connections
  • Historical metric graphs
  • Performance Insights integration
  • Multi-account support
  • Custom alert thresholds
  • Export metrics to CSV/JSON
  • Sparkline trends in menu

About

AWS RDS Metrics at your fingertips

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors