September 8th, 2024

Show HN: Goroutine Monitor Powered by eBPF

gmon is a monitoring tool for Go programs that tracks goroutine activity, requires amd64 architecture and Linux Kernel 5.8+, and exposes metrics in OpenMetrics format with configurable command-line options.

Read original articleLink Icon
Show HN: Goroutine Monitor Powered by eBPF

gmon is a monitoring tool for Go programs that tracks the creation and destruction of goroutines. It is built for amd64 architecture and requires a Linux Kernel version of 5.8 or higher, utilizing BPF ring buffers for its functionality. Users can run gmon with various command-line options, including setting log levels, specifying the executable file to monitor, and configuring ports for metrics and pprof servers. The tool logs goroutine creation events to stdout, providing stack traces for each event. Additionally, gmon exposes metrics in OpenMetrics format through a dedicated endpoint, tracking metrics such as goroutine creation, exit, and uptime. For development, users can build and test the tool using provided scripts, with options to install the binary to specific directories. A demo is also available in the repository for users to explore its capabilities further.

- gmon monitors goroutine activity in Go programs.

- It requires amd64 architecture and Linux Kernel 5.8 or higher.

- Users can configure various command-line options for monitoring.

- Metrics are exposed in OpenMetrics format on a dedicated endpoint.

- Development and testing can be done using provided scripts.

Link Icon 2 comments
By @tylerflick - 5 months
Cool stuff. Since this is eBPF, does the version of Go gmon is built with need to match the target binary’s version?