A powerful extension of PocketBase with extensive monitoring, logging, and analytics capabilities.
Real-time metrics for CPU, memory, disk, network, and runtime stats. Monitor your server's health at a glance.
Comprehensive logging with error tracking and request tracing for better debugging and system insights.
Track and analyze visitor statistics, page views, device types, and browsers to understand your user base.
Seamlessly piggybacks off PocketBase's superuser authentication and CSS for a consistent experience.
Here's how to get started with pb-ext:
package main import ( "log" "net/http" "strconv" "time" app "github.com/magooney-loon/pb-ext/core" "github.com/pocketbase/pocketbase/core" ) func main() { initApp() } func initApp() { srv := app.New() app.SetupLogging(srv) srv.App().OnServe().BindFunc(func(e *core.ServeEvent) error { app.SetupRecovery(srv.App(), e) return e.Next() }) registerRoutes(srv.App()) if err := srv.Start(); err != nil { srv.App().Logger().Error("Fatal application error", "error", err, "uptime", srv.Stats().StartTime, "total_requests", srv.Stats().TotalRequests.Load(), "active_connections", srv.Stats().ActiveConnections.Load(), "last_request_time", srv.Stats().LastRequestTime.Load(), ) log.Fatal(err) } }
To run the server:
go run cmd/server/main.go serve
├── cmd/ │ └── server/ # Server initialization └── core/ ├── logging/ # Logging and error handling ├── monitoring/ # System metrics collection └── server/ # Core server implementation
The enhanced dashboard provides a comprehensive view of your server's health and visitor analytics.
127.0.0.1:8090/_
127.0.0.1:8090/_/_
The dashboard utilizes PocketBase's superuser authentication system, ensuring that only authorized administrators can access the monitoring and analytics features.