Metrics
GET /api/metrics
Returns server metrics in Prometheus text format.
Available Metrics
Process Metrics
process_cpu_usage— Current CPU usage percentageprocess_memory_bytes— Resident memory in bytesprocess_uptime_seconds— Time since server start
HTTP Metrics
http_requests_total— Total number of HTTP requests receivedhttp_errors_total— Total number of HTTP error responses (4xx, 5xx)
GTFS Metrics
gtfs_agencies— Number of loaded agenciesgtfs_routes— Number of loaded routesgtfs_stops— Number of loaded stopsgtfs_trips— Number of loaded tripsgtfs_stop_times— Number of loaded stop times
Example
curl http://localhost:8080/api/metrics
# HELP process_cpu_usage Current CPU usage
# TYPE process_cpu_usage gauge
process_cpu_usage 12.5
# HELP process_memory_bytes Resident memory
# TYPE process_memory_bytes gauge
process_memory_bytes 524288000
# HELP http_requests_total Total HTTP requests
# TYPE http_requests_total counter
http_requests_total 15423
Prometheus Integration
Add Glove to your Prometheus scrape_configs:
scrape_configs:
- job_name: "glove"
scrape_interval: 15s
static_configs:
- targets: ["localhost:8080"]
metrics_path: "/api/metrics"
Frontend Metrics Panel
The frontend includes a built-in metrics dashboard accessible from the sidebar. It displays live values for CPU, memory, uptime, request counts, and GTFS statistics, polling the /api/metrics and /api/status endpoints.