This commit is contained in:
Mateusz Gruszczyński committed 2026-10-15 09:37:47 +02:00
1 parent bbfa8cbc3f
commit 2ccc598b12
49 files changed
+4771 -639

No files matched your search

+51
View File
@@ -56,6 +56,57 @@ Only `GET` on the exact configured path without a query string is accepted. A
wrong path is `404`, wrong method `405`, disallowed peer `403`, invalid/missing
required bearer `401`, and exporter concurrency exhaustion `429`.
## Web Server and PHP-FPM metrics (0.33.0)
Prometheus already exports core Web Server/PHP response counters by configured
`web_service` ID. The 0.33.0 additions below are enabled with the existing
Prometheus exporter (no new listener, credentials, options or open routes).
| Family | Type | Labels | Meaning |
|---|---|---|---|
| `rust_proxy_web_server_requests_total` | counter | `web_service` | Header-ready WWW responses, including PHP |
| `rust_proxy_web_server_responses_total` | counter | `web_service`, `class` | HTTP 2xx/3xx/4xx/5xx |
| `rust_proxy_web_server_response_header_duration_microseconds_total` | counter | `web_service` | Cumulative time until headers |
| `rust_proxy_web_server_requests_active` | gauge | `web_service` | Requests still awaiting headers |
| `rust_proxy_web_server_request_kind_total` | counter | `web_service`, `kind` | `static`, `php`, `other` handler |
| `rust_proxy_web_server_methods_total` | counter | `web_service`, `method` | `GET`, `POST`, `PUT`, `DELETE`, `other` |
| `rust_proxy_web_server_status_code_total` | counter | `web_service`, `status` | Selected 200/206/304/403/404/500/502/503 |
| `rust_proxy_web_server_response_body_bytes_total` | counter | `web_service` | Body bytes delivered before final compression |
| `rust_proxy_web_server_compression_total` | counter | `web_service`, `encoding` | Downstream gzip/br/zstd/deflate operations |
| `rust_proxy_php_requests_total` | counter | `web_service` | PHP response headers processed |
| `rust_proxy_php_responses_total` | counter | `web_service`, `class` | PHP response status classes |
| `rust_proxy_php_response_header_duration_microseconds_total` | counter | `web_service` | Cumulative PHP time until headers |
| `rust_proxy_php_response_body_bytes_total` | counter | `web_service` | PHP body bytes emitted before compression |
| `rust_proxy_php_concurrency_available` | gauge | `web_service` | Free RustProxy PHP request permits |
| `rust_proxy_php_concurrency_limit` | gauge | `web_service` | Configured concurrent PHP request limit |
| `rust_proxy_php_concurrency_in_use` | gauge | `web_service` | Permits currently held by PHP requests |
| `rust_proxy_php_failures_total` | counter | `web_service`, `reason` | Fixed FastCGI/PHP failure classes |
PHP `reason` is one of `capacity`, `connect_timeout`, `connect_error`,
`request_timeout`, `request_io`, `response_timeout`, `response_io`,
`invalid_response`, `body_io`. PHP concurrency is the admission semaphore in
RustProxy, not external PHP worker health or PHP-FPM child count. Status-code
labels are deliberately restricted to a stable, useful subset; arbitrary code,
request paths, IP addresses and untrusted method strings are not labels.
The exported byte counters are measured **before the final dynamic response
encoder**, so treat them as payload sizes rather than measured network transfer.
Precompressed static file delivery is not counted in the downstream compression
family. All time-to-headers metrics exclude streamed transfer duration.
Useful Grafana/PromQL examples:
```promql
sum(rate(rust_proxy_web_server_requests_total[5m]))
sum by (class) (rate(rust_proxy_web_server_responses_total[5m]))
sum by (kind) (rate(rust_proxy_web_server_request_kind_total[5m]))
100 * sum(rust_proxy_php_concurrency_in_use) / clamp_min(sum(rust_proxy_php_concurrency_limit), 1)
1e-3 * sum(rate(rust_proxy_web_server_response_header_duration_microseconds_total[5m])) / clamp_min(sum(rate(rust_proxy_web_server_requests_total[5m])), 1e-9)
sum by (reason) (rate(rust_proxy_php_failures_total[5m]))
```
Import `grafana/rustproxy-overview.json` and use the **Web service** variable
for the new Web Server, PHP-FPM, per-service and correlation sections.
## Coverage audit in 0.26.0
The exporter represents all scalar fields currently sampled by `diagnostics::View` when available. The per-interface `network_interfaces` list added in 0.18.6 is intentionally dashboard-only so kernel-created interface names cannot create an uncontrolled Prometheus label set. RustProxy also exports the bounded operational data already available from traffic metrics, cache, vhosts, backend pools, streams, logging, GeoIP and ACME renewal observations.