Fix format with telegraf before send data to influx

Hi
want to monitor ibm iib using this ib-metrics-pyclient, pushgateway and it will publish metrics each second on input http on server http://192.168.1.1:9091/metrics.

Add inputs.http plugin in telegraf and start and got this error:

telegraf[227536]: 2024-07-05T12:05:10Z E! [inputs.http] Error in plugin: [url=http://192.168.1.1>

parsing metrics failed: metric parse error: expected field at 3:49: “go_gc_duration_seconds{quantile="0"} 0.000208915”

current format that publish in http:

go_gc_duration_seconds{quantile=“0”} 0.000208915

Line protocol format:
measurement,tag1=value1,tag2=value2 field1=value3,field2=value4 timestamp

Expected output

go_gc_duration_seconds,quantile=“0” value=0.000208915 1625487910

Is there any way to fix in telegraf?

Thanks

You need to set the data_format value in yoru plugin. By default is is expected to be line protocol, but you can also use prometheus. See the input data formats list: