dynatrace-oss / logstash-output-dynatrace

A Logstash output plugin for sending logs to Dynatrace
4 stars 1 forks source link

Split large batches #31

Closed dyladan closed 1 year ago

dyladan commented 1 year ago

Fixes #30

Splits batches of events larger than 4.5MB into multiple requests in order to stay under the 5MB API limit.

Introduces a Batcher component which builds batches and counts the size of the resulting request body. The offer method returns true if the event is accepted as a part of the current batch or false if the event would make the batch too large. drain_and_serialize returns a JSON string request body for export and clears the array.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
2.6% 2.6% Duplication