Telegraf prometheus Input

I’m using telegraf to collect data and send output to Prometheus, but for Input type Prometheus (https://github.com/influxdata/telegraf/tree/master/plugins/inputs/prometheus), plugin is changing data and this is creating the discrepancy in the data.

What is suggested Input plugin for same, if we want to collect data as it is and send that to Prometheus using the telegraf?

What is being changed?

Can you give us an example of some input and the resulting output so we can
see the difference?

Antony.

As in example shown on the plugin page:

Example Output:

Source

# HELP go_gc_duration_seconds A summary of the GC invocation durations.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 7.4545e-05
go_gc_duration_seconds{quantile="0.25"} 7.6999e-05
go_gc_duration_seconds{quantile="0.5"} 0.000277935
go_gc_duration_seconds{quantile="0.75"} 0.000706591
go_gc_duration_seconds{quantile="1"} 0.000706591
go_gc_duration_seconds_sum 0.00113607
go_gc_duration_seconds_count 4

Output

go_gc_duration_seconds,url=http://example.org:9273/metrics 1=0.001336611,count=14,sum=0.004527551,0=0.000057965,0.25=0.000083812,0.5=0.000286537,0.75=0.000365303 1505776733000000000
go_goroutines,url=http://example.org:9273/metrics gauge=21 1505776695000000000

In my case:

Source

api_execution_time_seconds{api_name="POST/v1/getByCode",quantile="0.9",} 0.004030464

Is getting converted to:
Output

api_execution_time_seconds_bucket{api_name="POST/v1/getByCode",quantile="0.9",le="+Inf"} 0
api_execution_time_seconds_sum{api_name="POST/v1/getByCode",quantile="0.9",} 0
api_execution_time_seconds_count{api_name="POST/v1/getByCode",quantile="0.9",} 0

Problem is the same data is converted into the bucket, sum, and count by Prometheus parser and the value is somehow 0. I don’t want to run parse on this data and want to store in the Prometheus DB as it is.