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 scale field to mapping config #499

Merged
merged 2 commits into from Jun 2, 2023
Merged

Conversation

ebracho
Copy link
Contributor

@ebracho ebracho commented May 28, 2023

Fixes #498

This field allows configuring unit conversions in mappings. This is important for following prometheus best practices, which states that metrics should use base units (e.g. seconds, not milliseconds). For example:

mappings:
- match: foo.latency_ms
  name: foo_latency_seconds
  scale: 0.001
- match: bar.processed_kb
  name: bar_processed_bytes
  scale: 1024

@SuperQ
Copy link
Member

SuperQ commented May 29, 2023

Nice.

This needs a DCO sign-off. You can use git commit -s --amend to add it.

This field allows configuring unit conversions in mappings. For example:

mappings:
- match: foo.latency_ms
  name: foo_latency_seconds
  scale: 0.001
- match: bar.processed_kb
  name: bar_processed_bytes
  scale: 1024

Signed-off-by: Eddie Bracho <eddiebracho@gmail.com>
@matthiasr
Copy link
Contributor

Very nice! Only one more thing I would ask: could you please add a section to the README about this so others can find this feature? Bonus points if you include an example 😄

Signed-off-by: Eddie Bracho <eddiebracho@gmail.com>
@matthiasr
Copy link
Contributor

Wonderful, thank you!

@matthiasr matthiasr merged commit 80e119a into prometheus:master Jun 2, 2023
4 checks passed
matthiasr added a commit that referenced this pull request Jun 2, 2023
with changelogs for #504 and #499

Signed-off-by: Matthias Rampke <matthias@prometheus.io>
matthiasr added a commit to prometheus/graphite_exporter that referenced this pull request Jun 2, 2023
Strictly speaking we're just updating dependencies, but this imports the
scaling parameter feature from prometheus/statsd_exporter#499.

Signed-off-by: Matthias Rampke <matthias@prometheus.io>
@ebracho
Copy link
Contributor Author

ebracho commented Jun 2, 2023

Thanks for maintaining this project! It's been super helpful for us during a short-notice metrics pipeline migration.

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.

Feature Request: "scale" field in mapping config to convert units
3 participants