Skip to content
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

Looking at better logging in debug mode for snmp #706

Merged
merged 2 commits into from
May 1, 2024
Merged

Conversation

i3149
Copy link
Contributor

@i3149 i3149 commented Apr 30, 2024

Closes #705

Changes how debug level logging goes.

  • Removes 1 NR log which is confusing to the user.

  • Adds a log on each poll which looks like:

2024-04-29T22:26:23.125 ktranslate/ [Debug] KTranslate>bart (192.168.0.200) polling 1.3.6.1.2.1.1.4.0 using github.com/gosnmp/gosnmp.(*GoSNMP).WalkAll-fm took 6.968ms. attempt 0 of 2.
  • Adds a log after each metric poll (of all the oids) which looks like:
2024-04-29T22:28:33.472 ktranslate/ [Debug] KTranslate>bart Metrics Poll: In 453.71575ms polled 14 mibs, 0 missing.

Thoughts?

@i3149 i3149 requested a review from thezackm April 30, 2024 05:29
@thezackm
Copy link
Contributor

Can we add a tag to the kentik.snmp.Uptime metric that shows the current logging level? Something like tags.container_logging?
I'm concerned about blowing out storage if debug is left enabled. These logs are contextually valuable, but if left running I can see a problem on the horizon.

@i3149
Copy link
Contributor Author

i3149 commented May 1, 2024

How does this look:

"SysLogLevel": "Info",

There's a hack where things prefixed Sys only get added to Uptime. So this lets things happen with a min of fuss.

Copy link
Contributor

@thezackm thezackm left a comment

Choose a reason for hiding this comment

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

looks great; ty

@i3149 i3149 merged commit e1e3e22 into main May 1, 2024
1 check passed
@i3149 i3149 deleted the better-snmp-logs branch May 1, 2024 21:13
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.

💡 FR - Update debug logging
2 participants