diff --git a/dataplane-template/gatewayconfiguration.yaml b/dataplane-template/gatewayconfiguration.yaml index 7bd617e..7810acb 100644 --- a/dataplane-template/gatewayconfiguration.yaml +++ b/dataplane-template/gatewayconfiguration.yaml @@ -35,6 +35,18 @@ spec: value: "256k" - name: KONG_NGINX_HTTP_LARGE_CLIENT_HEADER_BUFFERS value: "4 32k" + # How much of a request body nginx keeps in memory. Past it the body + # goes to a temp file, and kong.request.get_raw_body() returns nil for + # a body on disk — so any plugin that reads the body silently stops + # working. That is what kept ai-proxy's log_payloads and log_statistics + # empty on the AI gateway, whose prompts run to 30 KB against this 8k + # default. + # + # Per domain, not global: the buffer is allocated per connection carrying + # a body, so a value that is free on a gateway seeing 18 requests a day + # is not free on one serving real traffic. + - name: KONG_NGINX_HTTP_CLIENT_BODY_BUFFER_SIZE + value: "${CLIENT_BODY_BUFFER_SIZE}" konnect: authRef: name: ${NAME} diff --git a/kong-platform/dataplane-template-defaults.yaml b/kong-platform/dataplane-template-defaults.yaml index e9cfbaf..e94994f 100644 --- a/kong-platform/dataplane-template-defaults.yaml +++ b/kong-platform/dataplane-template-defaults.yaml @@ -18,6 +18,9 @@ data: CORS_ORIGINS: https://*.sttlab.local RATE_LIMIT_MINUTE: "300" REQUEST_MAX_BODY_SIZE: "10" # MB + # nginx default. Domains that need to introspect larger bodies raise it + # in their own Kustomization; see the AI gateway. + CLIENT_BODY_BUFFER_SIZE: 8k # Tempo (OTLP-native), ns observability, cluster-wide — shared by every # domain, not domain-specific. Replaced Jaeger on 2026-08-25: Tempo is the # trace backend of the infra-observability stack, so its span metrics feed diff --git a/kong-platform/domain-defaults/dataplane-template-defaults.yaml b/kong-platform/domain-defaults/dataplane-template-defaults.yaml index 79be5f6..1979ff2 100644 --- a/kong-platform/domain-defaults/dataplane-template-defaults.yaml +++ b/kong-platform/domain-defaults/dataplane-template-defaults.yaml @@ -21,6 +21,9 @@ data: CORS_ORIGINS: https://*.sttlab.local RATE_LIMIT_MINUTE: "300" REQUEST_MAX_BODY_SIZE: "10" # MB + # nginx default. Domains that need to introspect larger bodies raise it + # in their own Kustomization; see the AI gateway. + CLIENT_BODY_BUFFER_SIZE: 8k # Tempo (OTLP-native), ns observability, cluster-wide — shared by every # domain, not domain-specific. Replaced Jaeger on 2026-08-25: Tempo is the # trace backend of the infra-observability stack, so its span metrics feed