[Bug]: content-length-guardrail policy does not mark streamed violations in analytics
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- observability
Direzione di ricerca
Start by locating the content-length-guardrail policy implementation and comparing the streamed response violation path with the request and buffered response paths that set analytics metadata. Trace where the stream violation sets its error and fault, then check the analytics event for isGuardrailHit and guardrailName. Done means streamed violations include both fields, matching the other violation paths.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/Monitoring (Metrics, observability, health checks, alerts)
Description
The content-length-guardrail policy does not mark a streamed response violation in analytics. The analytics event has no isGuardrailHit or guardrailName metadata.
Request violations and buffered response violations set both fields. When the policy ends a stream for a violation, it sets the error and the fault but leaves the analytics metadata empty.
The enforcement itself works. The client gets the guardrail's error event and the stream ends. Only the analytics record is incomplete. Dashboards and reports that count guardrail hits from this metadata miss every streamed violation.
Steps to Reproduce
- Create a REST API with the
content-length-guardrailpolicy on an operation, with analytics enabled on the Gateway:{"name":"content-length-guardrail","version":"v1","params":{"response":{"enabled":true,"min":1,"max":5}}} - Send a request whose upstream replies with an SSE stream. The first delta has more than 5 bytes of content:
data: {"choices":[{"delta":{"content":"this is longer than five bytes"}}]} data: [DONE] - The client gets the guardrail's SSE error event, and the stream ends. This is expected.
- Read the request's analytics event. It has neither
isGuardrailHitnorguardrailNamein its metadata. - Repeat with a request over a request-side
max, or a buffered response overmax. The event hasisGuardrailHit: trueandguardrailName: content-length-guardrail.
Severity Level of the Issue
Severity/Minor (Non-critical functionality. Can be fixed in future releases)
Environment Details (with versions)
- Policy:
content-length-guardrailv1.1.0, wso2/gateway-controllers main (4f1520a8) - Gateway versions: 1.1.0 (patched), 1.2.0 and latest (
main-59dcd51) - macOS 27.0.1 (Apple silicon), Colima 0.10.3, Docker Engine 29.5.2
- Lingua principale
- Go
- Stelle
- 85
- Fork
- 137
- Merge medio
- 1g 12h
- PR unite (30g)
- 247
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna 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 wso2/api-platform
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
wso2/api-platform#4369 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsApertaArea/Policies Aspect/Other Severity/Trivial Type/Bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
wso2/api-platform#4355 ·
I maintainer di solito rispondono entro 1 giorno
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
wso2/api-platform#4348 ·
I maintainer di solito rispondono entro 1 giorno
-
Aspect/AI Aspect/API. Severity/Major
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
wso2/api-platform#4343 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: content-length-guardrail policy accepts a non-string streamingJsonPath at API creationApertaArea/Policies Aspect/Configuration Severity/Minor Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
wso2/api-platform#4330 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di wso2/api-platform
Issue simili
-
benchmark
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
mozilla-ai/cq#601 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation migration
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno