open-policy-agent / open-policy-agent/java-opa-sdk
Gzip compression and upload size limits
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 16
- Forks
- 24
- Avg merge
- 8h 17m
- Merged PRs (30d)
- 15
Description
DecisionLogPlugin.DecisionLogs.sendToService POSTs the entire batch as uncompressed JSON regardless of size. OPA Go gzip-compresses decision-log batches and honors reporting.upload_size_limit_bytes, splitting batches that exceed it. The Java SDK should match both behaviors to keep operator expectations consistent and reduce bandwidth.
- Gzip the request body before sending; set
Content-Encoding: gzip. - Honor
reporting.upload_size_limit_bytes— chunk the batch into multiple POSTs when it exceeds the cap (size is measured after compression to match OPA Go). - If a single event exceeds the cap, log a warning and either send it on its own (with a flag) or drop it per a configurable policy.
- Tests covering: small batch single POST, large batch chunked into multiple POSTs, oversized single event handled.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at DecisionLogPlugin.DecisionLogs.sendToService and trace how batches are serialized, posted, and configured. Check how reporting.upload_size_limit_bytes is exposed, then add coverage for a compressed small batch, compressed size-based chunking, and an oversized single event. Done means requests use gzip, respect the cap, and apply a defined policy for oversized events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100