Pulse
Self-hosted observability and performance monitoring for Go applications built with Gin and GORM.
Pulse gives you full visibility into your application's HTTP requests, database queries, runtime metrics, errors, health checks, and external dependencies — all from a single Mount() call with zero external services required.
Table of Contents
Features
- Request Tracing — Automatic trace ID generation, latency tracking, throughput analysis, and slow request detection with configurable thresholds and sampling rates.
- Database Monitoring — GORM plugin that captures every query with duration, caller file:line, N+1 detection, query pattern aggregation, and connection pool stats.
- Runtime Metrics — Continuous sampling of heap memory, goroutines, GC pauses, and goroutine leak detection.
- Error Tracking — Panic recovery, stack traces, request body capture, error fingerprinting for deduplication, and automatic classification (validation, database, timeout, auth, etc.).
- Health Checks — Pluggable health check system with Kubernetes-compatible endpoints (
/live, /ready), composite status, and flapping detection.
- Alerting Engine — Threshold-based rules with two-phase firing (prevents false alerts), cooldown periods, and multi-channel notifications (Slack, Discord, Email, Webhooks with HMAC signatures).
- SLOs with burn-rate alerts — Multiwindow burn-rate alerting (Google SRE workbook), computed from exact per-minute counts of every request, so sampling never skews compliance. Survives restarts with the SQLite backend.
- Query plans for slow queries — Opt in and Pulse asks the database why a slow
SELECT is slow, reading the sequential scan or the filesort off the plan. EXPLAIN only, one plan per pattern per hour, off the request path.
- Per-route baselines — Each route's hourly p95 is summarised and kept for 30 days, so Pulse can say a route got slower, not just that it is slow. A sustained regression against the median of the last week pages once, with the numbers to decide on a rollback.
- Secret redaction — Passwords, tokens, card numbers, JWTs and keys are stripped from captured request context, error messages and outbound URLs before anything is stored, whatever the field name or naming style. Configurable.
- Load-test overlay — k6 (or any harness) runs appear as bands on the dashboard timelines, with a before/during/after comparison per route, query and N+1 deltas, time to recovery, and a CPU profile captured over the run so you can see which function got slow under load.
- Knows its own limits — Alerts when buffer capacity rather than your retention setting limits history, when writes are dropped, and after an unclean restart. Pulse's own failures are counted and exported.
- Dependency Monitoring — Wrap any
http.Client to track external API latency, error rates, and availability.
- WebSocket Live Updates — Real-time streaming of requests, errors, health checks, alerts, and runtime metrics to connected clients with per-client channel subscriptions.
- Prometheus Export — Standard exposition format endpoint for Grafana/Prometheus integration.
- Data Export — Export requests, queries, errors, runtime metrics, and alerts as JSON or CSV.
- JWT Authentication — Dashboard API protected with HS256 JWT tokens (no external auth library).
- Embedded React Dashboard — Full-featured UI with 12 pages (Overview, Routes, Database, Errors, Runtime, Health, Alerts, SLOs, USE, Test Runs, Flame Graph, Settings) embedded into the Go binary via
//go:embed. No separate frontend deployment needed.
- Zero External Dependencies — No Redis, no Kafka, no external collectors. Everything runs in-process, in memory or in a local SQLite file.
Dashboard
Pulse ships with a full React dashboard embedded directly into the Go binary using //go:embed. No separate frontend deployment, no CDN, no build step needed by consumers — just go get and it works.
URL: http://localhost:8080/pulse/ui/ (default credentials: admin / pulse)
Light and dark. The dashboard follows the operating system by default and the toggle in the top bar overrides it, remembered per browser. Every colour comes from one set of CSS custom properties, so both themes share the same layout, spacing and type — only the values change. Charts read the same tokens and redraw when the theme flips.
The shell. A 240px sidebar groups the pages under Observe, Reliability and Tools, with live counts beside Errors and Alerts and a status dot beside Health. The top bar carries the breadcrumb, a ⌘K search over routes, errors and pages, the environment, one time range shared by every page, a Live/Paused switch and the theme toggle.
Type and numbers. IBM Plex Sans for the interface, IBM Plex Mono with tabular figures for every number, route and SQL string, so columns line up and values are scannable. The fonts are self-hosted inside the binary — about 120KB — so the dashboard looks right on a host with no internet.
Pages:
| Page |
Description |
| Overview |
KPI cards (requests, error rate, latency, goroutines), throughput and error charts with load-test runs as bands and restarts as markers, top routes, recent errors, and a banner when data is missing after a restart |
| Routes |
Searchable route table with method badges, latency percentiles (P50/P95/P99), RPM, trend indicators; click for detail modal with latency distribution chart |
| Database |
KPI tiles with their window, a delta against the previous window and a status badge; a connection-pool card with a usage bar and Open / In use / Idle / Wait count readouts; tabs for slow queries, patterns, N+1 detections ranked by added latency with a severity band, and captured query plans |
| Errors |
Filterable error list (by type, muted, resolved); detail modal with full stack trace, mute/resolve/delete actions |
| Runtime |
Memory and goroutine line charts over time, system info (Go version, CPUs, PID); real-time updates via WebSocket |
| Health |
Health check cards with status badges and latency; run checks on-demand; per-check history table |
| Alerts |
Firing/critical/resolved summary; filterable alert table with rule, metric, value, threshold, and timestamps |
| SLOs |
Compliance, error budget, and long- and short-window burn rates per SLO, with data coverage |
| USE |
Utilization / Saturation / Errors grid per host resource |
| Test Runs |
Load-test runs with a before/during/after comparison and time to recovery |
| Flame Graph |
On-demand sampled flame graph (double-gated) |
| Settings |
Data export (JSON/CSV), storage capacity, current configuration display, danger zone data reset |
Login. A split screen: a brand panel that stays dark in both themes, and the form. The panel's three readouts — uptime, p95 latency and status — are real or blank, never invented; they come from the opt-in public status endpoint (see WithPublicStatus). "Keep me signed in" is what decides whether the session outlives the tab.
Tech Stack: React 19, React Router 7, Vite 6, Tailwind CSS 4, Recharts 2, IBM Plex (self-hosted), Lucide icons
Rebuilding the dashboard (contributors only):
cd ui/dashboard
npm install
npm run build # outputs to ui/dist/
The ui/dist/ directory is committed to the repo so consumers don't need Node.js.
Requirements
- Go 1.24 or later
- Gin v1.9+
- GORM v1.25+ (optional — pass
nil if not using a database)
Installation
go get github.com/MUKE-coder/pulse
Quick Start
package main
import (
"context"
"log"
"github.com/MUKE-coder/pulse/pulse"
"github.com/gin-gonic/gin"
"github.com/glebarez/sqlite"
"gorm.io/gorm"
)
func main() {
// Database (optional — pass nil to Mount if not using GORM)
db, err := gorm.Open(sqlite.Open("file::memory:?cache=shared"), &gorm.Config{})
if err != nil {
log.Fatal(err)
}
router := gin.Default()
// One line to mount Pulse. Pulse's background goroutines are tied to ctx —
// cancel it (e.g. on SIGINT) and Pulse shuts down cleanly.
ctx := context.Background()
pulse.Mount(ctx, router, db,
pulse.WithAppName("My API"),
pulse.WithDevMode(),
)
// Your application routes
router.GET("/api/users", func(c *gin.Context) {
c.JSON(200, gin.H{"users": []string{"alice", "bob"}})
})
// Dashboard: http://localhost:8080/pulse/ui/
// API: http://localhost:8080/pulse/api/
// Health: http://localhost:8080/pulse/health
// WebSocket: ws://localhost:8080/pulse/ws/live?token=<jwt> (auth required)
// Login: admin / pulse (default credentials — DevMode only)
log.Fatal(router.Run(":8080"))
}
After starting, Pulse automatically begins tracking every HTTP request, database query, runtime metric, and error. Open http://localhost:8080/pulse/ui/ to access the dashboard (default login: admin / pulse). The React dashboard is embedded into the Go binary — no separate frontend deployment needed.
Configuration
All configuration is optional. Pulse ships with sensible defaults — call pulse.Mount(ctx, router, db) with no options and everything works.
Configuration is supplied via functional options. The most common knobs have dedicated With* helpers; for everything else, build a pulse.Config and pass it via pulse.WithConfig(...).
// Granular form — preferred for one-off knobs.
pulse.Mount(ctx, router, db,
pulse.WithAppName("My API"),
pulse.WithDevMode(),
pulse.WithCredentials("admin", os.Getenv("PULSE_PASSWORD")),
pulse.WithSecretKeyFile("/var/lib/pulse/secret.key"),
pulse.WithSlackAlerts(os.Getenv("SLACK_WEBHOOK_URL")),
pulse.WithPrometheus(),
pulse.WithSlowRequestThreshold(500 * time.Millisecond),
)
// Config-struct form — preferred when loading from YAML/env.
pulse.Mount(ctx, router, db, pulse.WithConfig(pulse.Config{
Prefix: "/pulse",
AppName: "My API",
DevMode: true,
Dashboard: pulse.DashboardConfig{ /* ... */ },
Tracing: pulse.TracingConfig{ /* ... */ },
// ...
}))