-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[snmp] add scale factor in snmp metrics #11438
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no docs review required
pkg/collector/corechecks/snmp/internal/checkconfig/config_test.go
Outdated
Show resolved
Hide resolved
pkg/collector/corechecks/snmp/internal/checkconfig/config_metric.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes.
pkg/collector/corechecks/snmp/internal/checkconfig/config_metric.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -46,6 +46,7 @@ metrics: | |||
symbols: | |||
- OID: 1.3.6.1.2.1.2.2.1.14 | |||
name: ifInErrors | |||
scale_factor: 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
What does this PR do?
Add
scale_factor
option to metric, to enable abstraction over snmp metrics representing same concepts, in different scales.Motivation
This change is motivated by our will to provide memory usage metrics. Across all devices that exposes these metrics, they appear as:
Such metrics have names that are strictly related to the MIB they are defined on. For example, Cisco supports ciscoMemoryPoolUsed, Aruba sysExtMemoryUsed
We want to be able to abstract across all these different names, and send generic metrics such as
metric.usage
,metric.used
,metric.free
,metric.available
.As
metadata.csv
supports one unit per metric, we need to implement an abstraction mechanism before submission, thus we are adding a scale factor.In the example of
memory.used
, we will specify its unit asbyte
inmetadata.csv
, and for MIB exposing this metric in KB, we will add a factor of1000
Additional Notes
scale_factor
supports only numbers: this doesn't cover all possible scenarios in SNMP, as some SNMP metrics' units are defined in OIDs. We considered supporting scale factor defined in other OIDs too complex for now.Possible Drawbacks / Trade-offs
Describe how to test/QA your changes
scale_factor
to the symbol definition of scalar metricscale_factor
to the symbol definition of a column metricReviewer's Checklist
Triage
milestone is set.major_change
label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.changelog/no-changelog
label has been applied.qa/skip-qa
label is not applied.team/..
label has been applied, indicating the team(s) that should QA this change.need-change/operator
andneed-change/helm
labels have been applied.