Skip to content

moderato-app/live-pprof

Repository files navigation

Xnip2024-09-05_22-25-31

You don’t want to clutter up your computer with Docker, Prometheus, Grafana or even K8S just to monitor a Go app's heap size, right?

Use live-pprof to Monitor a Go app's performance. It launches in 1 second, boosting your local development.

Install

go install github.com/moderato-app/live-pprof@v1

Usage

Step 1: setup pprof endpoints

package main

import (
	"log"
	"net/http"
	_ "net/http/pprof"
)

func main() {
	log.Println(http.ListenAndServe("localhost:6060", nil))
}

Step 2: monitor the pprof endpoints

live-pprof 6060 
# Or:
live-pprof http://localhost:6060/debug/pprof
# Both commands will monitor http://localhost:6060/debug/pprof