Analytics
Traffic and WAF events are written to a bundled ClickHouse instance and queried back as charts. It is optional; everything else works without it.
Requests over time
Hosts
| Host | Requests | Share | Actions |
|---|---|---|---|
app.example.com | 389 | 57.9% | |
cloud.example.com | 154 | 22.9% | |
grafana.example.com | 129 | 19.2% |
Paths
| Path | Requests | Share | Actions |
|---|---|---|---|
/ | 193 | 28.7% | |
/assets/app.js | 107 | 15.9% | |
/login | 95 | 14.1% | |
/media/stream | 94 | 14% | |
/api/items | 87 | 12.9% | |
/admin/config.php | 34 | 5.1% |
Status codes
| Status | Requests | Share | Actions |
|---|---|---|---|
200 | 502 | 74.7% | |
403 | 105 | 15.6% | |
404 | 34 | 5.1% | |
502 | 14 | 2.1% | |
401 | 9 | 1.3% | |
429 | 8 | 1.2% |
WAF rules
| Rule | Hits | Share | Actions |
|---|---|---|---|
#930130 Restricted File Access Attempt | 55 | 57.3% | |
#913100 Found User-Agent associated with security scanner | 41 | 42.7% |
Latest requests
| Time | Client | Host | Request | Status | Outcome | Duration | Size |
|---|---|---|---|---|---|---|---|
203.0.113.66 | app.example.com | GET /.env | 403 | WAF | 2 ms | 0 B | |
203.0.113.66 | app.example.com | GET /.env | 403 | WAF | 2 ms | 0 B | |
203.0.113.66 | app.example.com | GET /wp-login.php | 403 | WAF | 2 ms | 0 B | |
203.0.113.66 | app.example.com | GET /wp-login.php | 403 | WAF | 2 ms | 0 B | |
198.51.100.44 | app.example.com | GET /media/stream | 200 | Served | 40 ms | 19.6 KB | |
2001:db8:ceac::42 | app.example.com | POST /media/stream | 200 | Served | 49 ms | 56.2 KB | |
198.51.100.52 | cloud.example.com | GET /login | 200 | Served | 37 ms | 85.8 KB | |
198.51.100.55 | cloud.example.com | GET /media/stream | 404 | Served | 67 ms | 8.8 KB |
- GET /.envapp.example.com - 203.0.113.66 - 403WAF
- GET /.envapp.example.com - 203.0.113.66 - 403WAF
- GET /wp-login.phpapp.example.com - 203.0.113.66 - 403WAF
- GET /wp-login.phpapp.example.com - 203.0.113.66 - 403WAF
- GET /media/streamapp.example.com - 198.51.100.44 - 200Served
- POST /media/streamapp.example.com - 2001:db8:ceac::42 - 200Served
- GET /logincloud.example.com - 198.51.100.52 - 200Served
- GET /media/streamcloud.example.com - 198.51.100.55 - 404Served
What you get
Section titled “What you get”- Five headline numbers: requests, bandwidth, unique IPs, mitigated requests (and their share) and the 5xx rate, each with a sparkline and its change from the period before.
- Requests over time, with the previous period drawn behind as a dashed line. Split the chart by outcome, status class or host (the five busiest, the rest together).
- Why each request ended. Every request is recorded with its outcome: served, or the gate that answered it, which is one of WAF, geo block, access list (a refused address), sign-in (a wrong basic-auth password, or a forward-auth server that said no), rate limit or CrowdSec. Anything but served counts as mitigated. Its duration is recorded too.
- Filters on everything: host, path, country, network (ASN), status code or class (
404,5xx), method, HTTP version, client IP, user-agent family, outcome and WAF rule, each as is or is not. Every top-list row has a button to show only it or leave it out. - Top lists of hosts, paths, countries, networks, status codes, client IPs, user agents, methods, HTTP versions and WAF rules. Each shows ten; View all shows up to 100.
- A country map, from the same GeoIP databases geo blocking uses. Colour it by requests, mitigated requests or unique IPs, and pick a country to see which hosts it reached, how they answered, and which user agents it sent.
- The latest requests, with their outcome and duration, or only the mitigated ones.
- CSV export of the chart’s buckets and of every list. A value a client sent that a spreadsheet would run as a formula is kept as text.
- Ranges of 1 hour, 24 hours, 7 days and 30 days, or a custom range of up to 92 days. Ranges of a day or less refresh every 30 seconds.
The page keeps its whole state (range, comparison, grouping, filters) in its address, so a link opens exactly what you were looking at.
Saved views
Section titled “Saved views”Views → Save… stores the current state under a name. Pick one from the menu to open it; from Manage… you can rename it, save the current state over it, copy its link or delete it. Ticking Share with every administrator lists it for everyone who can open analytics; only its owner can change it. Each person can keep up to 100. Saving, changing and deleting a view are in the audit log.
How the outcome is worked out
Section titled “How the outcome is worked out”The generated Caddy config marks each gate a request reaches (WAF, geo block, access list, sign-in, rate limit, CrowdSec) and logs the last one it got to with the request. A request a gate turns away never gets past the mark, so that gate is its outcome; one that clears them all is served. A host with no gates logs no mark and is always served.
Rows recorded before this existed, or relayed by an agent older than it, count as served (or as geo-blocked where the geo blocker logged them) and have no duration. The network column needs the GeoLite2 ASN database, which the controller downloads with the others when a MaxMind key is set.
A WAF rule filter matches requests by client and path against the WAF events the rule logged, since the access log does not know the rule. The WAF rule list follows the host, path, country, client IP and method filters, the ones a WAF event carries.
Traffic signals
Section titled “Traffic signals”The controller also looks for traffic worth a look, over the last 24 hours:
- 5xx bursts: at least 10 5xx answers making up at least 10% of a host’s requests in those minutes, with runs less than three minutes apart joined. A burst with a 5xx in the last five minutes is still going on.
- Mitigation spikes: at least 50 mitigated requests, and at least three times the average for a window that long over the 7 days before it, for one host or for all of them together.
- Blocked traffic concentrations: one host, path and outcome with at least 50 mitigated requests.
They are in the API as trafficSignals; each detector has a time budget, and one that
runs out is reported as skipped rather than holding the answer up.
Turning it on
Section titled “Turning it on”Open Settings → Observability → Analytics, tick Collect analytics, and set a ClickHouse
password. Saving starts the container. You do not change .env or list a compose profile, because the
agent runs the compose command for you with the saved credentials.
Three things to expect:
- The first start pulls the ClickHouse image, which takes a few minutes on a slow link. The save returns immediately, and the Analytics page fills in once ClickHouse is up.
- Turning it off stops the container but keeps the data. History survives, and turning it back on picks up where it left off.
- Pick one owner. Once credentials live in Settings, drop
clickhousefromCOMPOSE_PROFILESand deleteCLICKHOUSE_PASSWORDfrom.env. Leaving both means your owndocker compose up -dalso creates the container, from the now-stale.envvalues.
Without an agent, Docker is the only thing that can start ClickHouse, so use the profile:
COMPOSE_PROFILES=clickhouseCLICKHOUSE_PASSWORD=your-clickhouse-password # openssl rand -base64 32Retention
Section titled “Retention”30 days by default, enforced by ClickHouse’s own TTL. Change it under Settings → Observability →
Analytics (or CLICKHOUSE_RETENTION_DAYS until a value is stored). Saving it re-checks the
schema on the next write, which migrates the existing tables’ TTL and purges expired data, without
a restart.
Disk writes
Section titled “Disk writes”ClickHouse’s internal diagnostic log tables are turned off by a config override the stack mounts. Left on, they flush every few seconds whether or not anyone is using the proxy, which is several GB a day on an idle machine. CPM never queries them.
Logs in the sidebar tails the raw logs, read through an agent so a remote host’s are there too:
- Access: every request Caddy logged, one line each, when access logging is on (Settings → Observability → Logging). A proxy host’s Logs action opens this, filtered to its domain.
- WAF: the rules the WAF matched.
- Caddy: Caddy’s own output, straight from its container.
- Certificates: only the issuance and renewal lines from Caddy’s output, for when a certificate won’t come through.
It follows new lines as they arrive, pauses on request, and filters what it has on screen. It needs no ClickHouse: the agent reads Caddy’s log files and its container’s output. Only administrators can open it, because access logs name every client and every path they asked for. An agent older than the log viewer can’t serve it; update it.