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 option to map measurement names to field name into prometheus input #3407

Closed

Conversation

pyry
Copy link

@pyry pyry commented Oct 30, 2017

Added support for re-mapping output field names to use measurement name e.g. instead of gauge = 1 output kube_deployment_status_replicas_available = 1. Need for this rose in our project where we are pulling data from kube-state-metrics prometheus client using telegraf and sending it to InfluxDB. We wanted all the metrics to be stored under single measurement as a separate series to enable various operations such calculating ratios such as mean(kube_deployment_status_replicas) / mean(kube_deployment_status_replicas_available) etc. After this PR one would achieve this by setting measurement_name_as_field_name=true and name_override=kube.

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson
Copy link
Contributor

This is something that we have been talking about internally a bit, I think we also need to use the same measurement name in order to use operators and functions:

cpu_usage_user{cpu="cpu3"} 42
cpu_usage_guest{cpu="cpu3"} 42
prometheus,cpu=cpu3 cpu_usage_user=42,cpu_usage_guest=42

One question that has come up is, what to name the measurement?

@pyry
Copy link
Author

pyry commented Oct 30, 2017

Yeah, using the option in the pr really makes sense when combined with name_override forcing the measurement to be the same for all metrics from the same input. Configurable measurement name with sensible default such as ´prometheus´ would probably work if one would want to go that direction that this setting should also mutate the measurement name: E.g. if measurement_name_override etc. is set then that is used as a measurement name and field names become the original prometheus metric_name.

@gangseok514
Copy link

@danielnelson this PR has no plan to commit?

Copy link

@gangseok514 gangseok514 left a comment

Choose a reason for hiding this comment

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

+1

@danielnelson danielnelson added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin area/prometheus labels Jul 20, 2018
@danielnelson
Copy link
Contributor

I think we won't merge this pr as is, or at least without doing more research, but let's associate it with #4415. I would like someone to take an inventory of our prometheus metric conversions and then we can discuss how to improve the situation.

@sjwang90
Copy link
Contributor

Closing as this was address in #5767.

Feel free to re-open if it's not the case.

@sjwang90 sjwang90 closed this Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prometheus feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants