Failing to rename fields from Prometheus inputs

telegraf
prometheus

#1

Hello !

I am trying unsuccessfully to rename fields collected from Prometheus input plugins, whatever I try using the rename processor seems just to be ignored.

The example I am trying to rename:

raw curl extract from Prometheus:

# HELP kafka_controller_ActiveControllerCount_Value Attribute exposed for management (kafka.controller<type=KafkaController, name=ActiveControllerCount><>Value)
# TYPE kafka_controller_ActiveControllerCount_Value untyped
kafka_controller_ActiveControllerCount_Value 0.0

Which results in the output to: (output to file here in my target Splunk metrics format)

kafka_controller_ActiveControllerCount_Value,host=ip-10-0-0-26,url=http://127.0.0.1:18080/metrics value=0 1544959942000000000

If I switch to graphite with tags format in the file output:

kafka_controller_ActiveControllerCount_Value;host=ip-10-0-0-26;url=http:--127.0.0.1:18080-metrics 0 1544960362

I have unsuccessfully tried all variances from:

[[processors.rename]]
  [[processors.rename.replace]]
    field = "kafka_controller_ActiveControllerCount_Value"
    dest = "kafka_controller.ActiveControllerCount"

But nothing seems to affect the name of the field…
My purpose is having Jolokia and Prometheus collection ending with the same format such my apps will work with both.

Am I missing something ?

Than you very much for your help !

Guilhem


#2

I have actually found it :wink:

  [[processors.rename.replace]]
    measurement = "kafka_controller_ActiveControllerCount_Value"
    dest = "kafka_controller.ActiveControllerCount.Value"

Works now.