Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

gmon

> 编程语言
Open source

An eBPF tool monitoring a goroutine

190 stars0 likes1 views
WebsiteGitHub

About

An eBPF tool monitoring a goroutine

Goroutine MONitor (gmon)

gmon is a tool designed to monitor the creation and destruction of goroutines in a Go program, drawing inspiration from the presentation Real World Debugging with eBPF.

Prerequisites

  • amd64 (x86_64)
  • Linux Kernel 5.8+ since gmon uses BPF ring buffer
  • Target Go binary must be compiled with Go 1.23+ since gmon uses fixed offset to get goroutine ID

Usage

Usage of gmon:
  -level string
    	log level could be one of ["DEBUG" "INFO" "WARN" "ERROR"] (default "INFO")
  -metrics int
    	Port to be used for metrics server, /metrics endpoint (default 5500)
  -path string
    	Path to executable file to be monitored (required)
  -pid int
    	Useful when tracing programs that have many running instances
  -pprof int
    	Port to be used for pprof server. If 0, pprof server is not started
  -trace string
    	Path to Go runtime/trace output

Demo

https://github.com/keisku/gmon/assets/41987730/838fa12d-d622-4ad6-a9f0-6aab88acec55

Stdout

gmon logs the creation of goroutines to stdout with stack traces.

…

OpenMetrics

gmon exposes the following metrics in the OpenMetrics format on the GET /metrics.

  • gmon_goroutine_creation
  • gmon_goroutine_exit
  • gmon_goroutine_uptime
…

Development

Follow the Docker installation guide to build and run tests.

bash
# Build and output the binary to ./bin
./gmon.sh build
# Build and install the binary to /usr/bin
./gmon.sh install
# Run tests
./gmon.sh test

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goebpfgogolang

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言