Prometheus Metrics
Mimicrab exports Prometheus-compatible metrics to help you monitor the health and performance of your mock server.
Metrics Endpoint
Metrics are available at the following admin endpoint:
GET /_admin/metrics
Available Metrics
Mock Performance
mimicrab_requests_total: Total number of requests handled.- Labels:
matched(true/false),path.
- Labels:
mimicrab_request_duration_seconds: Histogram of request latencies (including Lua execution and Proxying).- Labels:
path.
- Labels:
Process Metrics (Linux only)
Mimicrab also exports standard process metrics including:
process_cpu_seconds_totalprocess_resident_memory_bytesprocess_virtual_memory_bytesprocess_open_fdsprocess_max_fds
Scraping with Prometheus
Add the following job to your prometheus.yml:
scrape_configs:
- job_name: 'mimicrab'
metrics_path: '/_admin/metrics'
static_configs:
- targets: ['localhost:3000']