Caddy
This feature is available starting from simob version 0.8.3
Monitor HTTP requests, errors, traffic, and resource usage from your local Caddy server. The agent probes the Caddy admin API to collect real-time performance data, helping you track traffic spikes and server health.
Setup
Preparing Caddy for monitoring requires ensuring the admin API is enabled and accessible to the agent.
- Enable the admin API: By default, Caddy enables the admin API on
localhost:2019. If you have disabled it or changed the port, ensure it is active. - Global options: You can explicitly enable metrics in your
Caddyfileusing global options:{ admin 127.0.0.1:2019 } - Restart Caddy: Apply any configuration changes by restarting or reloading Caddy.
- Restart the agent: Restart
simobto trigger service discovery:sudo systemctl restart simob.
Configuration
The agent automatically discovers Caddy metrics if they are exposed on the default http://localhost:2019/metrics endpoint. No additional configuration is required.
Metrics
The following metrics are collected from the Caddy admin API:
| Metric | Type | Unit | Description |
|---|---|---|---|
caddy_http_requests_total | Gauge | reqs | Total number of HTTP requests processed. |
caddy_http_requests_rate | Gauge | reqs/s | Rate of HTTP requests per second. |
caddy_http_errors_total | Gauge | errs | Total number of HTTP errors (4xx and 5xx). |
caddy_http_errors_rate | Gauge | errs/s | Rate of HTTP errors per second. |
caddy_http_response_bytes | Gauge | bytes | Total bytes sent in HTTP responses. |
caddy_http_response_bps | Gauge | B/s | Throughput of response data in bytes per second. |
caddy_http_request_duration_ms | Gauge | ms | Total time spent processing requests. |
Troubleshooting
Verify the endpoint
Test locally using curl to ensure Caddy is correctly exposing statistics:
curl http://localhost:2019/metrics
Discovery check
If Caddy metrics are not appearing, verify that the admin API is bound to 127.0.0.1 and that the agent has permission to access it.