Operations & Monitoring
Monitor your BoxLang runtime with health checks, performance snapshots, JVM diagnostics, and scheduler oversight.
This guide covers the operational workflows for monitoring your BoxLang runtime using the bx-mcp tools.
🏥 Health Checks
System-Wide Health
The system_get_health tool provides a single round-trip health assessment of all subsystems:
curl -s http://localhost:8080/~bxmcp/boxlang.bxm \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-token" \
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"system_get_health","arguments":{}},"id":"1"}'This returns a consolidated report with:
Overall status —
healthy,warning, orcriticalScore — 0-100 numeric score (weakest-link model)
Per-subsystem health — datasources, caches, watchers, schedulers, executors, web server
All issues — Merged across subsystems with severity and suggested actions
Subsystem Health Checks
For drill-down analysis, each subsystem has its own health tool:
Caches
cache_get_health
Hit rates, eviction thrashing, enabled status
Datasources
datasource_get_health
Pool utilization, saturation, thread waiters
Executors
executor_get_health
Saturation, queue depth, shutdown status
Schedulers
scheduler_get_health
Task failures, paused tasks, scheduler state
Watchers
watcher_get_health
Error counts, stopped watchers
Web Server
undertow_get_health
Worker saturation, queue depth, error rates
📊 Performance Snapshot
The performance_get_snapshot tool captures a holistic view of runtime performance in a single call:
The snapshot includes:
Memory — Heap and non-heap usage, pool breakdown
Garbage Collection — Collection counts and cumulative time
CPU — Available processors, system load, process CPU time
Threads — Thread counts by state
Top Executors — Most utilized async executor pools
Slow Queries — Recent slow SQL samples
Slow Requests — Recent slow inbound requests
Slow HTTP — Recent slow outbound HTTP/SOAP calls
Buffer Pools — Direct and mapped buffer usage
Web Server — Undertow worker pool and listener metrics (when available)
Health Report — Built-in structured health assessment with recommendations
💻 JVM Monitoring
Memory Analysis
Thread Analysis
Garbage Collection
Resource Usage
⏰ Scheduler Monitoring
View All Schedulers and Tasks
Check Scheduler Health
Get Task Execution Statistics
📈 Executor Monitoring
View All Async Executors
Check Executor Health
🌐 Web Server Monitoring
Undertow Server Stats
Returns worker pool metrics (core, max, busy, queue depth), IO pool, listener connection/request/error counts, and WebSocket connections.
�️ Route Metrics
The routeMetrics setting enables per-route request metrics — count, error rate, and latency histograms (p50/p95/p99) — captured by the RouteMetricsCollector interceptor. Routes are identified as METHOD /normalized-path.
Enable Route Metrics
enabled
true
Enable per-route inbound request metrics
maxRoutes
200
Maximum unique routes tracked; least-recently-seen evicted
normalizePathParams
true
Replace digit-only and UUID segments with {id} (e.g., /users/123 → /users/{id})
Query Route Metrics
Route normalization prevents metric table explosion on REST APIs — /users/123/orders/abc-123 becomes /users/{id}/orders/{id}.
�📋 Daily Health Check Script
Here's a BoxLang script that performs a comprehensive daily health check:
📚 Next Steps
Data Layer Diagnostics — Cache analysis, datasource health, and slow SQL diagnosis
Incident Response — Triage and error response workflows
MCP Prompts Reference — Pre-built diagnostic prompts
Last updated
Was this helpful?
