-
Notifications
You must be signed in to change notification settings - Fork 45
Standardized Logging for Policy Developers #754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
renuka-fernando
wants to merge
6
commits into
wso2:main
Choose a base branch
from
renuka-fernando:stream
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
14978e3
Remove policy engine request_header_mode config
renuka-fernando 61c4757
Standardized logging for policy developers
renuka-fernando 4904574
Update launch.json with system manifest file
renuka-fernando 5b70c6e
Update policies to use the new standard logger
renuka-fernando 275685e
Add ensure logger func
renuka-fernando 8441c2f
Update sdk version in all policies
renuka-fernando File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 178
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 161
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 161
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 114
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 2913
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 3252
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 296
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 28131
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 14250
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 1579
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 5122
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 288
🏁 Script executed:
Repository: wso2/api-platform
Length of output: 4446
🌐 Web query:
Envoy ext_proc ProcessingMode FULL_DUPLEX_STREAMED vs BUFFERED modes documentation💡 Result:
Short summary — main differences
BUFFERED: Envoy buffers the entire request/response body (up to configured limits) and sends it to the external processor as a single message. If the buffer limit is exceeded the body is truncated or an error is produced. Use when the processor needs the whole body at once (e.g., full-body inspection/mutation). [1][2]
FULL_DUPLEX_STREAMED: Body data is sent as a bidirectional stream of chunks (full‑duplex). Envoy and the external processor can concurrently stream body chunks and the processor may send streamed responses (including streamed immediate responses). This mode disables some per‑message semantics (different response rules, different timeout behavior) and is intended for low‑latency, streaming interactions where processor can act on chunks as they arrive. Mode overrides are not supported for FULL_DUPLEX_STREAMED. [1][3]
Notable operational details
Sources
Change initial
ProcessingModeto support dynamic mode overrides.The hardcoded
ProcessingMode_FULL_DUPLEX_STREAMEDfor body modes prevents Envoy from acceptingModeOverridemessages, which breaks the policy-engine's dynamic optimization mechanism.Per Envoy ext_proc documentation: mode overrides are not supported when initial body mode is
FULL_DUPLEX_STREAMED. Since your config setsAllowModeOverride: trueand the policy-engine implements intelligentgetModeOverride()(returningBUFFEREDonly when policies need body access,NONEotherwise), the initial mode should be:ProcessingMode_BUFFERED(orSKIPfor headers-only) — allows per-requestModeOverridemessagesFULL_DUPLEX_STREAMEDconstraintThis way, header-only policies (authentication, rate-limiting) will skip body buffering, and only policies requiring body inspection will trigger buffering. With current config, all requests incur full-duplex streaming overhead regardless of actual policy requirements.
Code location
🤖 Prompt for AI Agents