mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-27 10:47:35 +00:00
ipn/localapi: print hostinfo and health on bugreport (#5816)
This information is super helpful when debugging and it'd be nice to not have to scroll around in the logs to find it near a bugreport. Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
This commit is contained in:
parent
4102a687e3
commit
d7c0410ea8
@ -26,6 +26,8 @@ import (
|
|||||||
|
|
||||||
"tailscale.com/client/tailscale/apitype"
|
"tailscale.com/client/tailscale/apitype"
|
||||||
"tailscale.com/envknob"
|
"tailscale.com/envknob"
|
||||||
|
"tailscale.com/health"
|
||||||
|
"tailscale.com/hostinfo"
|
||||||
"tailscale.com/ipn"
|
"tailscale.com/ipn"
|
||||||
"tailscale.com/ipn/ipnlocal"
|
"tailscale.com/ipn/ipnlocal"
|
||||||
"tailscale.com/ipn/ipnstate"
|
"tailscale.com/ipn/ipnstate"
|
||||||
@ -223,6 +225,13 @@ func (h *Handler) serveBugReport(w http.ResponseWriter, r *http.Request) {
|
|||||||
if note := r.FormValue("note"); len(note) > 0 {
|
if note := r.FormValue("note"); len(note) > 0 {
|
||||||
h.logf("user bugreport note: %s", note)
|
h.logf("user bugreport note: %s", note)
|
||||||
}
|
}
|
||||||
|
hi, _ := json.Marshal(hostinfo.New())
|
||||||
|
h.logf("user bugreport hostinfo: %s", hi)
|
||||||
|
if err := health.OverallError(); err != nil {
|
||||||
|
h.logf("user bugreport health: %s", err.Error())
|
||||||
|
} else {
|
||||||
|
h.logf("user bugreport health: ok")
|
||||||
|
}
|
||||||
if defBool(r.FormValue("diagnose"), false) {
|
if defBool(r.FormValue("diagnose"), false) {
|
||||||
h.b.Doctor(r.Context(), logger.WithPrefix(h.logf, "diag: "))
|
h.b.Doctor(r.Context(), logger.WithPrefix(h.logf, "diag: "))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user