🐛 Bug Description
Current code path in monitoring/web.go:
handleDashboard uses template.Must(template.New("dashboard").Parse(dashboardTemplate))
dashboardTemplate includes {{printf "%.2f" (div .Metrics.MemAllocBytes 1048576.0)}}
This can panic at runtime when / is requested.
🔁 Steps to Reproduce
Steps to reproduce the behavior:
- Enable monitoring (
ENABLE_MONITORING=true)
- Start the plugin
- Open
http://localhost:<MONITORING_PORT>/
- Observe handler panic / template parse failure because function
div is undefined
✅ Expected Behavior
Dashboard should render successfully and show memory metrics in MB without panic.
❌ Actual Behavior
Dashboard handler can panic due to undefined template function div.
🧪 Reproducibility
📸 Screenshots / Logs
NA
Logs