Description
Short description
From the documentation the upload_size_limit_bytes
configuration says Decision log upload size limit in bytes. OPA will chunk uploads to cap message body to this limit.
. This limit is there for the user to configure the maximum size the message body will be when sent over the network. The decision log plugin sends multiple events as gzipped chunks. In practice the upload_size_limit_bytes
also is being used to limit the events uncompressed size. I think this is unexpected behavior, and controlling the individual event size should be a separate configuration. A configuration like this hasn't been requested by users, so I think the best thing would be to fix upload_size_limit_bytes
to only restrict the compressed size.
Steps To Reproduce
Using the latest OPA version (v1.4.2) with the following policy:
package example
allow if {
true
}
and the following config:
services:
fakeservice:
url: http://localhost:8080
decision_logs:
service: fakeservice
reporting:
upload_size_limit_bytes: 400
The uncompressed size of the event will be 435 bytes, which exceed the upload_size_limit_bytes
. Although when the event is compressed it should fit just fine but when running OPA as a server and sending a decision:
> opa run -c opa-conf.yaml --server ./example.rego
> curl -X POST http://localhost:8181/v1/data/example/allow
the following error is logged:
{"level":"error","msg":"Log encoding failed: upload chunk size (435) exceeds upload_size_limit_bytes (400).","plugin":"decision_logs","time":"2025-05-09T16:00:55-05:00"}
Metadata
Metadata
Assignees
Type
Projects
Status