prometheus / procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Apache License 2.0
754 stars 311 forks source link

Add support for for /proc/net/tls_data kTLS stats #579

Closed defect closed 4 months ago

defect commented 9 months ago

Since Linux kernel 4.17 (I believe) there is support to move some TLS operations to kernel space, enabling things like TLS sendfile to improve performance. Statistics for this feature is exposed under /proc/net/tls_stats. This PR adds support to read these statistics. It is very much based on the support for /proc/net/xfrm_stats in net_xfrm.go as they both share the same format.

For more info on Linux kTLS see https://docs.kernel.org/networking/tls.html.

discordianfish commented 8 months ago

Would be nice if we could make the parsing for /proc/net/xfrm_stats more generic and re-use that here, but I think it's fine either way

defect commented 8 months ago

Yeah, i was thinking about refactoring that out but didn't really find a clean way to do it. Maybe using annotated structs a la json and yaml and friends? But that feels a bit overkill, at least for now.

discordianfish commented 8 months ago

@defect Fair enough, that might be better be part of a bigger refactoring