-
Notifications
You must be signed in to change notification settings - Fork 2k
fix(host_metrics source): fix tcp netlink bug #24441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
hmm i guess i have to split this into 2 prs - will do in a bit |
|
looks like grafana is interpreting the new inode metrics as counters for some reason, will double check the format in a bit |
d7bf682 to
aa4e264
Compare
…aders add netlink to allowed words list
aa4e264 to
f9138ac
Compare
|
Have now split the inodes bit onto another branch which i will PR separately. |
I think this is just grafana getting confused when you only have one host with a metric and the metric keeps going up. the format of the JSON is fine by the looks of it - i suspect the warning will disappear once you have more than one host (warning also doesn't appear on the inode ratio) |
Summary
fix tcp metrics netlink parsing error (#22487)
fixes the "Could not parse netlink response: Decode error occurred: invalid
netlink buffer" error that occurs when collecting tcp metrics. this was caused
by
socket.recv()with a fixed 4096 byte buffer but didn't track how many byteswere actually received.
changed to use
socket.recv_from_full()which returnsVec<u8>containing onlythe actual received bytes.
Vector configuration
How did you test this PR?
all tests pass. Have also made a docker image @ tocalabs0509/vector:dev, which
works including the new bits. Note that it's a nix container I made for
testing just these changes, so other stuff e.g. journald doesn't work on it, but
should work in the final image.
Change Type
Is this a breaking change?
Does this PR include user facing changes?
guidelines.
no-changeloglabel to this PR.References
Files Changed
src/sources/host_metrics/tcp.rs- fixed netlink receive to userecv_from_full()Extra note
I was building this on my system using Nix, for which I wrote a flake.nix. I
assumed that people wouldn't want a flake.nix and flake.lock clogging up the
root of the repo so I haven't included it, but if this is wanted I'm happy to
add to the PR.
https://github.com/mushrowan/vector-flake in case you want to look.