coroot / coroot-node-agent

A Prometheus exporter based on eBPF that gathers comprehensive container metrics
https://coroot.com/docs/metrics/node-agent
Apache License 2.0
312 stars 55 forks source link

Avoiding unnecessary allocations in the case of truncated mongodb packets #26

Closed def closed 1 year ago

def commented 1 year ago

The size of the payload transferred from the eBPF program to the agent is limited to 512 bytes. In certain scenarios, a much larger buffer could be allocated for parsing a mongodb packet.

This PR adds a validation to ensure that a MongoDB packet is not truncated before parsing BSON.

Issue #16