open-policy-agent / open-policy-agent/java-opa-sdk

Gzip compression and upload size limits

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

decision-logs services
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.