Skip to content

Introduce parsing for /proc/<pid>/net/snmp, /proc/<pid>/net/snmp6 and /proc/<pid>/net/netstat. - #435

Merged
pgier merged 3 commits into
prometheus:masterfrom
nikakis:introduce-support-for-snmp
Apr 1, 2022
Merged

pgier merged 3 commits into
prometheus:masterfrom
nikakis:introduce-support-for-snmp

Conversation

@nikakis

@nikakis nikakis commented Feb 14, 2022

Copy link
Copy Markdown
Contributor

No description provided.

@SuperQ

SuperQ commented Feb 14, 2022

Copy link
Copy Markdown
Member

Nice, do we have to worry about missing fields in various kernel versions? We like to be able to support very old kernels in this library, since Go will run on kernels as old as 2.6.23.

@nikakis

nikakis commented Feb 17, 2022

Copy link
Copy Markdown
Contributor Author

@SuperQ I believe according to this RFC it seems that we will be fine.

@SuperQ

SuperQ commented Feb 17, 2022 •

Copy link
Copy Markdown
Member

Any chance I can also get you to implement snmp6 parsing in this PR too?

@nikakis

nikakis commented Feb 17, 2022

Copy link
Copy Markdown
Contributor Author

Sure i will implement snmp6 and netstat also.
Maybe i can also do the refactoring on the node_exporter side when this is done.

@nikakis nikakis changed the title Introduce parsing for /proc/<pid>/net/snmp. Introduce parsing for /proc/<pid>/net/snmp, /proc/<pid>/net/snmp6 and /proc/<pid>/net/netstat. Feb 18, 2022
@nikakis
nikakis force-pushed the introduce-support-for-snmp branch from a8481ba to c0cd365 Compare February 18, 2022 11:57
@nikakis

nikakis commented Feb 18, 2022

Copy link
Copy Markdown
Contributor Author

@SuperQ I added also snmp6 and netstat. Have a look please!

Comment thread .gitignore Resolved
Comment thread proc_netstat.go Resolved
Comment thread proc_snmp.go Resolved
@nikakis
nikakis force-pushed the introduce-support-for-snmp branch from c0cd365 to 978dee6 Compare February 21, 2022 10:06
… and `/proc/<pid>/net/netstat`.

Signed-off-by: Nikos Kakavas <[email protected]>
@nikakis
nikakis force-pushed the introduce-support-for-snmp branch from 978dee6 to 3d753b0 Compare February 21, 2022 10:10
Comment thread proc_netstat.go Resolved
Comment thread proc_snmp.go Resolved
Signed-off-by: Nikos Kakavas <[email protected]>
@nikakis
nikakis force-pushed the introduce-support-for-snmp branch from dc5e963 to 5c12586 Compare March 9, 2022 15:23
@nikakis

nikakis commented Mar 9, 2022

Copy link
Copy Markdown
Contributor Author

@discordianfish @SuperQ Have a look again please!

@discordianfish discordianfish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, LGTM!

@nikakis
nikakis requested a review from SuperQ March 10, 2022 08:31
@nikakis

nikakis commented Mar 15, 2022

Copy link
Copy Markdown
Contributor Author

Hello! @discordianfish @SuperQ
Sorry for spamming but any update with merging this?
Thanks!

@discordianfish

Copy link
Copy Markdown
Member

Still needs a LGTM from @SuperQ or @pgier

@pgier pgier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just had a couple of optional in-line suggestions.

Comment thread proc_netstat.go Resolved
Comment thread proc_netstat.go Resolved
Comment thread proc_snmp.go Resolved
@nikakis
nikakis force-pushed the introduce-support-for-snmp branch from 99e9c79 to 18c4ef8 Compare March 30, 2022 12:21
@nikakis
nikakis force-pushed the introduce-support-for-snmp branch from 18c4ef8 to 6ff7304 Compare March 30, 2022 12:29
@pgier
pgier merged commit d917e64 into prometheus:master Apr 1, 2022
@nikakis
nikakis deleted the introduce-support-for-snmp branch April 3, 2022 16:31
Comment thread proc_snmp6.go
// and returns a map contains those metrics.
func parseSNMP6Stats(r io.Reader) (ProcSnmp6, error) {
var (
scanner = bufio.NewScanner(r)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did this gofmt issue not surfaced in the PR? @SuperQ @pgier any idea?

@nikakis nikakis Apr 14, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix this fmt issue and also try to investigate why this didn't worked properly

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. Maybe out of date source branch?

remijouannet pushed a commit to remijouannet/procfs that referenced this pull request Oct 20, 2022
…snmp

Introduce parsing for `/proc/<pid>/net/snmp`, `/proc/<pid>/net/snmp6` and `/proc/<pid>/net/netstat`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants