prometheus / procfs

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

feat: Make `net_(tcp|udp)` read limit configurable #622

Closed rexagod closed 1 month ago

rexagod commented 3 months ago

Defaults to 4GiB otherwise, as earlier.

Fixes: #364

rexagod commented 1 month ago

Rebased. Ready for reviews.

discordianfish commented 1 month ago

I think we should just implement the ptr function ourselves, it's just this:

// To returns a pointer to the given value.
func To[T any](v T) *T {
    return &v
}
rexagod commented 1 month ago

Initially, I did have doubts around changing the public signature, even though we don't guarantee any backward compatibilities, but I decided to go forward with the patch anyway since that was the only way of addressing the issue (there was the possibility of adding readLimit to FS, but that made little sense as it wasn't at all cohesive).

Seeing that we use netlink as a replacement for this, I'm fine with closing out this PR and adding a deprecation notice. Thank you for all the details.