Noureddine RAMDI / macmon: sudoless Apple Silicon power monitoring with Rust

Created Mon, 04 May 2026 10:23:01 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

vladkens/macmon

macmon takes a different approach to monitoring Apple Silicon power and system metrics — it taps into private macOS APIs to access hardware counters directly, sidestepping the need for root privileges that most tools require. This makes it a practical option if you want detailed power metrics on M1 through M5 chips without running sudo or complicated setups.

What macmon offers and how it’s built

At its core, macmon is a Rust CLI tool focused on monitoring power consumption and system metrics specifically on Apple Silicon Macs. Unlike popular tools like asitop, which wrap the powermetrics command requiring sudo, macmon reverse-engineers a private API to read hardware counters directly from the system. This is a neat technical workaround that avoids elevated privileges.

The project is written entirely in Rust, leveraging the language’s safety and performance. It provides three main output modes:

  • An interactive TUI (terminal user interface) with switchable themes and multiple chart views for real-time monitoring.
  • A JSON pipe mode intended for scripting and integration into other command-line workflows.
  • An HTTP server that exposes metrics in JSON and Prometheus formats for remote monitoring and observability setups.

Beyond the CLI, macmon also ships as a Rust library, allowing developers to embed Apple Silicon metric collection into their own Rust applications or tools.

Installation is flexible with support for Homebrew, MacPorts, Cargo, and Nix package managers, reflecting a well-maintained ecosystem approach. The repo also includes a ready-to-run example using Prometheus and Grafana via docker-compose, showcasing practical monitoring dashboards out of the box.

Technical strength: direct private API access without sudo

The standout feature here is macmon’s use of a private macOS API to monitor Apple Silicon hardware counters directly. Most existing tools like powermetrics require root to access these counters, limiting their accessibility and automation in production or developer environments.

By reverse-engineering and tapping into this private API, macmon provides a sudoless experience, which is a significant usability win. However, the tradeoff is reliance on an undocumented API that Apple could change or restrict in future macOS releases. This means users should be aware that macmon’s functionality might break with OS updates, requiring maintenance or fixes.

The code quality benefits from Rust’s strict compiler checks and safety guarantees, which is evident in the clean modular design and the ability to offer the monitoring functionality as a reusable library. This lowers the barrier for developers wanting to build on top of macmon’s metrics collection.

The TUI itself is thoughtfully designed, supporting multiple themes and chart types, which help visualize power consumption and CPU usage trends interactively. The HTTP server mode with Prometheus metrics makes it suitable for integration into existing observability stacks, which is a common requirement in production monitoring.

Quick start

Install macmon using brew:

brew install macmon

Or via MacPorts:

sudo port install macmon

You can also install using Cargo:

cargo install macmon

Or through Nix:

nix-env -i macmon

To set up Prometheus scraping, add this job to your prometheus.yml:

scrape_configs:
  - job_name: macmon
    static_configs:
      - targets: ["localhost:9090"]

For a full local example with Prometheus and Grafana, run:

macmon serve --port 9090
cd example-grafana
docker compose up -d

This provisions Prometheus at http://localhost:9091 and Grafana at http://localhost:9000 with a prebuilt Macmon Overview dashboard. Use macmon as both username and password to log in.

You can then query metrics like:

macmon_cpu_power_watts{chip="Apple M3 Pro"}
macmon_ecpu_usage_ratio{chip="Apple M3 Pro"}
macmon_memory_ram_used_bytes{chip="Apple M3 Pro"}

Verdict

macmon is a solid choice if you want detailed, sudoless power and system metrics on Apple Silicon Macs. The approach of using private macOS APIs is clever but comes with the risk of breakage on OS updates since the APIs are undocumented. Its Rust codebase and modular design make it a good fit both as a standalone tool and as a library for embedding metrics collection.

This tool is relevant to system engineers, macOS power users, and developers building observability or monitoring solutions around Apple Silicon hardware. If you need a rootless option that plays well with Prometheus and Grafana, macmon is worth trying. Just keep in mind the maintenance cost tied to private API dependencies.

Overall, macmon balances usability and technical depth in a space where most solutions require root, making it a practical option for many real-world monitoring scenarios.


→ GitHub Repo: vladkens/macmon ⭐ 1,544 · Rust