Requests and latency by endpoint, split by client
I maintainer di solito rispondono entro 4 giorni
Una pull request collegata è già stata integrata.
- #2156 di @alanpeixinho — integrata
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, data-visualization, observability
Direzione di ricerca
Start by reading #2144, get_client_info, and BackendRequestMetricsMiddleware to understand the existing client label and counter. Trace the dashboard panels named in the issue and the existing Django latency histogram. Done means API requests are recorded once with endpoint and client labels, the requested count and p50/p95 panels use the new histogram, and the listed kci-dev, Chrome, curl, and /admin/ cases pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
"Total Calls by Endpoint" and "Average Response Time by Endpoint" both read django_http_requests_latency_seconds_by_view_method, labeled only by view and method. A browser session and a kci-dev call to the same view are one line. The average mixes them, and the board shows no p50 or p95. "Total Calls by Endpoint" is that histogram's _count, not a separate counter.
Ben asked for requests by endpoint, and for p50 and p95, split between the browser and kci-dev. Don asked for webpage use versus API use. Both are the same cut: the dashboard UI and the CLI call the same API.
Almost every view is already under /api/. Outside it, only /admin/ and /health/ exist, and health is already excluded. Timing those API calls again on the Django histogram would duplicate them without a client label.
Proposal
Depends on #2144, which adds client (dashboard, kci-dev, script, bot, unknown) in get_client_info and puts that label on the existing counter dashboard_backend_requests_by_client_total. No new counter.
Record latency once, in BackendRequestMetricsMiddleware, for /api/ only. On that same request, increment the existing counter and observe a histogram labeled by endpoint and client, using the same buckets as the Django latency histogram. The histogram's _count is the latency count. Stop observing django_http_requests_latency_seconds_by_view_method for /api/ requests. Leave that histogram for /admin/. Leave the Django middleware's other counters (status, exceptions) as they are.
Counts. Point "Total Calls by Endpoint" at dashboard_backend_requests_by_client_total, summed by endpoint and client. Filter with client, not a list of browser names. script, bot, and unknown stay on the panel, so the total still matches the counter.
Latency. Point "Average Response Time by Endpoint" and the latency half of "Endpoint Performance Summary" at the new histogram (_sum / _count). Add p50 and p95 from its buckets, split by client.
Tests
- A
kci-dev/<version>request and a Chrome request to the same endpoint land onclient="kci-dev"andclient="dashboard", on the existing counter and on the new histogram, and are not observed ondjango_http_requests_latency_seconds_by_view_method. - A
curl/request lands onclient="script"and stays visible on both. - An
/admin/request is still observed on the Django latency histogram.
- Lingua principale
- Python
- Stelle
- 10
- Fork
- 32
- Merge medio
- 4g 12h
- PR unite (30g)
- 23
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi 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.
Altre issue di kernelci/dashboard
-
Frontend q4-plan
Difficoltà 2/5 Mezza giornata Idoneità per principianti 65/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
I maintainer di solito rispondono entro 4 giorni
-
Show the last hardware registry syncForse già presa @alanpeixinho l’ha presa 3 giorni fa. ApertaBackend Frontend q4-plan
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
kernelci/dashboard#2170 · 1 assegnatario ·
I maintainer di solito rispondono entro 4 giorni
-
Backend q4-plan
Difficoltà 4/5 3-5 giorni Idoneità per principianti 24/100
kernelci/dashboard#2169 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
[Labs] Design the lab details pageForse già presa @alanpeixinho l’ha presa 4 giorni fa. ApertaFrontend q4-plan
Difficoltà 5/5 3-5 giorni Idoneità per principianti 30/100
kernelci/dashboard#2168 · 1 assegnatario ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di kernelci/dashboard
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
webrecorder/warcio#209 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Jeffy123-zhu/logspecter#20 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno