shreemaan-abhishek opened a new pull request, #13665:
URL: https://github.com/apache/apisix/pull/13665

   ### Description
   
   Follow-up to #13653 (already merged), addressing the review note there about 
the coalesced datagram having no size guard.
   
   #13653 coalesces an entry's metrics into a single newline-delimited 
DogStatsD datagram. Because each line repeats the full tag suffix, the 
coalesced packet is ~6x a single metric line. With long tag sources 
(`constant_tags` has no `maxItems`, route/service/consumer names can be long, 
`include_path` adds the route path), the packet can exceed the DogStatsD 
agent's default receive buffer (`dogstatsd_buffer_size`, 8192 bytes) and be 
**silently truncated** — `sock:send()` only returns an error above the OS max 
UDP size (~64KB on Linux), so nothing catches it. This is a regression versus 
the previous one-datagram-per-metric behaviour, where each datagram was ~6x 
smaller.
   
   This PR sends the coalesced datagram only when it fits within 8192 bytes; 
otherwise it falls back to one datagram per metric (the original size profile). 
A single socket is still reused across the batch, so the syscall win from 
#13653 is preserved for the common case.
   
   ### Tests
   
   Adds a test with oversized `constant_tags` (coalesced payload > 8192) 
asserting every metric still arrives via the fallback path.
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation accordingly (no user-facing 
config/behaviour change)
   - [x] I have verified linting passes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to