Feature Request
The Prometheus Remote Writer Parser added in #8682 should parse metrics in the same way that the Prometheus Remote Write InfluxDB endpoint does, as defined here:
https://docs.influxdata.com/influxdb/v1.8/supported_protocols/prometheus/#how-prometheus-metrics-are-parsed-in-influxdb
Proposal:
When parsing the metrics, each field should become the measurement name. The only field in the metric should be "value", and should always be a float. This matches what InfluxDB would do.
Current behavior:
Currently, all metrics are output to a single measurement: prometheusremotewrite, as defined here: https://github.com/influxdata/telegraf/blob/master/plugins/parsers/prometheusremotewrite/parser.go#L58
Desired behavior:
Rather than outputting everything into the same measurement (which will cause a massive set of field/tag keys), metrics should be output into a measurement that matches the field name. We should loop through all metrics, setting the measurement to the name of the field, and then setting the only field to "value", converting the field's value to a float. Text fields would be dropped.
Use case:
In its current state, this is only useable for extremely small clusters or testing purposes. The set of tag/field keys for the prometheusremotewrite measurement will quickly balloon for anything past testing purposes. This also breaks from the expectation when using Influx's prometheus remote write integration, which could be confusing for users that would like to use Telegraf as a relay to Influx.
This would also more closely preserve data model integrity for outputs that are sending to prometheus.
Feature Request
The Prometheus Remote Writer Parser added in #8682 should parse metrics in the same way that the Prometheus Remote Write InfluxDB endpoint does, as defined here:
https://docs.influxdata.com/influxdb/v1.8/supported_protocols/prometheus/#how-prometheus-metrics-are-parsed-in-influxdb
Proposal:
When parsing the metrics, each field should become the measurement name. The only field in the metric should be "value", and should always be a float. This matches what InfluxDB would do.
Current behavior:
Currently, all metrics are output to a single measurement:
prometheusremotewrite, as defined here: https://github.com/influxdata/telegraf/blob/master/plugins/parsers/prometheusremotewrite/parser.go#L58Desired behavior:
Rather than outputting everything into the same measurement (which will cause a massive set of field/tag keys), metrics should be output into a measurement that matches the field name. We should loop through all metrics, setting the measurement to the name of the field, and then setting the only field to "value", converting the field's value to a float. Text fields would be dropped.
Use case:
In its current state, this is only useable for extremely small clusters or testing purposes. The set of tag/field keys for the
prometheusremotewritemeasurement will quickly balloon for anything past testing purposes. This also breaks from the expectation when using Influx's prometheus remote write integration, which could be confusing for users that would like to use Telegraf as a relay to Influx.This would also more closely preserve data model integrity for outputs that are sending to prometheus.