aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2025-12-19 16:14:10 +0100
committerDmitry Vyukov <dvyukov@google.com>2025-12-22 09:48:26 +0000
commit66849ad520ec127b99c7065f5d248d6593415c1b (patch)
treed496980ed39b10edb7a0efa23fdf7380afc56fa4 /dashboard
parent49b0fb03849fcfed4c30395cb7da84491de40a58 (diff)
dashboard/app: add pprof handlers
These are useful for debugging of deadlocks, hangs (slowness), and memory consumption issues. Can be used on a local instance during development. On the production system pprof handlers are restricted to admins only.
Diffstat (limited to 'dashboard')
-rw-r--r--dashboard/app/app.yaml3
-rw-r--r--dashboard/app/main.go1
2 files changed, 3 insertions, 1 deletions
diff --git a/dashboard/app/app.yaml b/dashboard/app/app.yaml
index c30738886..04e3941f7 100644
--- a/dashboard/app/app.yaml
+++ b/dashboard/app/app.yaml
@@ -25,7 +25,8 @@ handlers:
- url: /static
static_dir: dashboard/app/static
secure: always
-- url: /(admin|cron/.*)
+# debug is for net/http/pprof handlers.
+- url: /(admin|debug|cron/.*)
script: auto
login: admin
secure: always
diff --git a/dashboard/app/main.go b/dashboard/app/main.go
index 3b1749a45..dbf95d502 100644
--- a/dashboard/app/main.go
+++ b/dashboard/app/main.go
@@ -10,6 +10,7 @@ import (
"fmt"
"html/template"
"net/http"
+ _ "net/http/pprof" // app.yaml restricts this to admins
"net/url"
"os"
"regexp"