divan / expvarmon

TermUI based monitor for Go apps using expvars (/debug/vars). Quickest way to monitor your Go app(s).
MIT License
2.02k stars 101 forks source link

No data collected #2

Closed mDomingues closed 9 years ago

mDomingues commented 9 years ago

Hi, really liked this project. It has a future indeed. I have a Go server app running with a routing middleware that is not the net/http. After setting the import and "go get" the project, no data is collected within expvarmon. Is it because is not http routing ?

Many thanks

divan commented 9 years ago

Yes, it's because expvar declares handler for http.DefaultServeMux via http.HandleFunc. See: http://golang.org/src/expvar/expvar.go?s=6520:6531#L332

So, the best solution is to run http.ListenAndServe() on another port. It may be even better solution, because generally /debug/vars should not be open to the public network because of security reasons.