You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(metrics)!: add "server" label to per-worker series
Workers declared in distinct php_server blocks can share a name now that
the per-scope routing landed; without a second label dimension, their
metric series collide on the existing "worker" label. This adds a sibling
"server" label (resolved via ScopeLabel(w.backgroundScope) at every call
site) so each (server, worker) pair stays on its own series.
BREAKING CHANGE: every Metrics interface method that took (name string)
now takes (server, name string). Embedders implementing frankenphp.Metrics
need to widen their signatures; PrometheusMetrics and the null impl are
updated in-tree. Mirrors the shape of #1376 (which introduced the
"worker" label the same way).
Copy file name to clipboardExpand all lines: docs/metrics.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ When [Caddy metrics](https://caddyserver.com/docs/metrics) are enabled, FrankenP
13
13
-`frankenphp_total_threads`: The total number of PHP threads.
14
14
-`frankenphp_busy_threads`: The number of PHP threads currently processing a request (running workers always consume a thread).
15
15
-`frankenphp_queue_depth`: The number of regular queued requests
16
-
-`frankenphp_total_workers{worker="[worker_name]"}`: The total number of workers.
17
-
-`frankenphp_busy_workers{worker="[worker_name]"}`: The number of workers currently processing a request.
18
-
-`frankenphp_worker_request_time{worker="[worker_name]"}`: The time spent processing requests by all workers.
19
-
-`frankenphp_worker_request_count{worker="[worker_name]"}`: The number of requests processed by all workers.
20
-
-`frankenphp_ready_workers{worker="[worker_name]"}`: The number of workers that have called `frankenphp_handle_request` at least once.
21
-
-`frankenphp_worker_crashes{worker="[worker_name]"}`: The number of times a worker has unexpectedly terminated.
22
-
-`frankenphp_worker_restarts{worker="[worker_name]"}`: The number of times a worker has been deliberately restarted.
23
-
-`frankenphp_worker_queue_depth{worker="[worker_name]"}`: The number of queued requests.
16
+
-`frankenphp_total_workers{server="[server]",worker="[worker_name]"}`: The total number of workers.
17
+
-`frankenphp_busy_workers{server="[server]",worker="[worker_name]"}`: The number of workers currently processing a request.
18
+
-`frankenphp_worker_request_time{server="[server]",worker="[worker_name]"}`: The time spent processing requests by all workers.
19
+
-`frankenphp_worker_request_count{server="[server]",worker="[worker_name]"}`: The number of requests processed by all workers.
20
+
-`frankenphp_ready_workers{server="[server]",worker="[worker_name]"}`: The number of workers that have called `frankenphp_handle_request` at least once.
21
+
-`frankenphp_worker_crashes{server="[server]",worker="[worker_name]"}`: The number of times a worker has unexpectedly terminated.
22
+
-`frankenphp_worker_restarts{server="[server]",worker="[worker_name]"}`: The number of times a worker has been deliberately restarted.
23
+
-`frankenphp_worker_queue_depth{server="[server]",worker="[worker_name]"}`: The number of queued requests.
24
24
25
-
For worker metrics, the `[worker_name]` placeholder is replaced by the worker name in the Caddyfile, otherwise the absolute path of the worker file will be used.
25
+
For worker metrics, the `[worker_name]` placeholder is replaced by the worker name in the Caddyfile, otherwise the absolute path of the worker file will be used. The `[server]` label identifies the `php_server` block that declared the worker; the Caddy module resolves it to the first host of the route's host matcher (e.g. `api.example.com`), falling back to the user-set Caddy server name and finally to the first listener address. Same-named workers in distinct `php_server` blocks therefore stay on distinct series.
0 commit comments