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

Add a scaling factor #1026

Merged
merged 1 commit into from
Oct 22, 2023
Merged

Add a scaling factor #1026

merged 1 commit into from
Oct 22, 2023

Conversation

SuperQ
Copy link
Member

@SuperQ SuperQ commented Oct 18, 2023

Allow the metric value to be pre-scaled based on a float64 multiplier. This allows for simple unit conversions like bits to bytes, centi-degrees, etc.

Fixes: #734

@SuperQ SuperQ force-pushed the superq/scale branch 3 times, most recently from 222f90d to e6e6f73 Compare October 18, 2023 10:18
@SuperQ SuperQ requested a review from RichiH October 18, 2023 10:47
Allow the metric value to be pre-scaled based on a float64 multiplier.
This allows for simple unit conversions like bits to bytes,
centi-degrees, etc.

Fixes: #734

Signed-off-by: SuperQ <[email protected]>
@SuperQ
Copy link
Member Author

SuperQ commented Oct 18, 2023

CC @bastischubert

@bastischubert
Copy link
Member

very nice, one thing that i noticed is that we do almost the same with modbus_exporter but named it "factor" instead of "scale"

@matthiasr
Copy link

Conversely, in the statsd exporter we use scale 😂

@SuperQ SuperQ merged commit dbfe95c into main Oct 22, 2023
@SuperQ SuperQ deleted the superq/scale branch October 22, 2023 16:22
@RichiH
Copy link
Member

RichiH commented Oct 22, 2023 via email

stephan-windischmann-sky pushed a commit to stephan-windischmann-sky/snmp_exporter that referenced this pull request Oct 27, 2023
Allow the metric value to be pre-scaled based on a float64 multiplier.
This allows for simple unit conversions like bits to bytes,
centi-degrees, etc.

Fixes: prometheus#734

Signed-off-by: SuperQ <[email protected]>
Signed-off-by: Stephan Windischmann <[email protected]>
@freeyssu
Copy link

Very nice feature that all want to get it.
When would this MR be released? Do you guys have a plan?

SuperQ added a commit that referenced this pull request Nov 24, 2023
* [ENHANCEMENT] generator: Add support for subsequent address family #782
* [ENHANCEMENT] generator: Fix lookups to match OIDs closer to the index OID. #828
* [FEATURE] Add a scaling factor #1026
* [FEATURE] generator: Enable passing input file, output file, and mibs dir as flags #1028
* [FEATURE] Add an offset factor #1029
* [BUGFIX] Fix and optimize generator Docker image building #1045

snmp.yml changes:

* Override `bsnAPName` to DisplayString #660
* Import TP-Link EAP MIB  #833
* Updated Mikrotik neighbor indexes make them unique #986
* Update PowerNet MIB to v4.5.1 #1003
* Refactor HOST-RESOURCES-MIB #1027
* Update keepalived MIB files to latest version #1044

Signed-off-by: SuperQ <[email protected]>
@SuperQ SuperQ mentioned this pull request Nov 24, 2023
SuperQ added a commit that referenced this pull request Nov 26, 2023
* [ENHANCEMENT] generator: Add support for subsequent address family #782
* [ENHANCEMENT] generator: Fix lookups to match OIDs closer to the index OID. #828
* [FEATURE] Add a scaling factor #1026
* [FEATURE] generator: Enable passing input file, output file, and mibs dir as flags #1028
* [FEATURE] Add an offset factor #1029
* [BUGFIX] Fix and optimize generator Docker image building #1045

snmp.yml changes:

* Override `bsnAPName` to DisplayString #660
* Import TP-Link EAP MIB  #833
* Updated Mikrotik neighbor indexes make them unique #986
* Update PowerNet MIB to v4.5.1 #1003
* Refactor HOST-RESOURCES-MIB #1027
* Update keepalived MIB files to latest version #1044

Signed-off-by: SuperQ <[email protected]>
SuperQ added a commit that referenced this pull request Dec 6, 2023
* [ENHANCEMENT] generator: Add support for subsequent address family #782
* [ENHANCEMENT] generator: Fix lookups to match OIDs closer to the index OID. #828
* [FEATURE] Add a scaling factor #1026
* [FEATURE] generator: Enable passing input file, output file, and mibs dir as flags #1028
* [FEATURE] Add an offset factor #1029
* [BUGFIX] Fix and optimize generator Docker image building #1045

snmp.yml changes:

* Override `bsnAPName` to DisplayString #660
* Import TP-Link EAP MIB  #833
* Updated Mikrotik neighbor indexes make them unique #986
* Update PowerNet MIB to v4.5.1 #1003
* Refactor HOST-RESOURCES-MIB #1027
* Update keepalived MIB files to latest version #1044

Signed-off-by: SuperQ <[email protected]>
SuperQ added a commit that referenced this pull request Dec 10, 2023
* [ENHANCEMENT] generator: Add support for subsequent address family #782
* [ENHANCEMENT] generator: Fix lookups to match OIDs closer to the index OID. #828
* [FEATURE] Add a scaling factor #1026
* [FEATURE] generator: Enable passing input file, output file, and mibs dir as flags #1028
* [FEATURE] Add an offset factor #1029
* [BUGFIX] Fix and optimize generator Docker image building #1045

snmp.yml changes:

* Override `bsnAPName` to DisplayString #660
* Import TP-Link EAP MIB  #833
* Updated Mikrotik neighbor indexes make them unique #986
* Update PowerNet MIB to v4.5.1 #1003
* Refactor HOST-RESOURCES-MIB #1027
* Update keepalived MIB files to latest version #1044

Signed-off-by: SuperQ <[email protected]>
@SuperQ SuperQ mentioned this pull request Feb 4, 2024
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.

Alternative to regex_extracts for scaled integer values
5 participants