Support fastcgi parameter in FPM for status page to display request meta data
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.1k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
Description
The full FPM status page has very little request data to pinpoint actual running requests and see what's running to get some indication of pool health issues.
It starts with the request uri that actually just shows the request from php, but not the original request - i.e. with a typical front controller pattern it's just something like /front.php. There is already a bug report for that: https://bugs.php.net/bug.php?id=72319 , but I'd suggest that it could stay the same if the real request uri could be added as meta data.
In addition to data a fastcgi param could also be used for different meta data like a client up, nginx request id, etc. It's content and meaning would be in total control of the one using it. FPM itself wouldn't need to do more than showing it in the full status page.
A concrete usage would look like this in a nginx config (param name just for presentation purpose):
fastcgi_param FPM_STATUS_REQUEST_METADATA "$remote_addr $request_id $request_uri";
which would result in an output like that:
[...]
************************
pid: 1234
state: Running
start time: 27/Jun/2022:00:00:00 +0000
start since: 0
requests: 1
request duration: 10
request method: GET
request URI: /front.php
content length: 100
user: -
script: /httpdocs/front.php
last request cpu: 0.00
last request memory: 0
request metadata: 127.0.0.1 A1B2D3E4F5 /hello/world
************************
[...]
Note: Of course a workaround is sending this as get parameters, but that's not pretty and can break scripts assuming a specific format of the query string or not seeing unknown get parameters.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando il modo in cui FPM analizza i parametri FastCGI e assembla l’output completo della pagina di stato. Usa l’esempio richiesto di nginx fastcgi_param e l’output di stato di esempio come riferimento comportamentale. Il lavoro è completato quando i metadati accettati della richiesta vengono visualizzati per la richiesta in esecuzione pertinente, senza modificare i campi della richiesta esistenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, nginx, php
- Ambito
- backend, observability
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100