Telegraf: histogram from prometheus to influxdb

Hi,

I’m trying to configure telegraf to scrape prometheus input and output to influxdb.

The problem I see is that histograms from prometheus are sent as-is to influx. This causes Influx to contain metric “something_latency” with multiple fields describing counts per histogram bucket. The line sent to influx looks like this:

something_latency,environment=staging,via=telegraf 0.5=51907,10=51909,0.25=51872,count=51909,0.025=33143,sum=1250.5342124830183,0.01=17427,5=51909,0.005=19,0.05=46594,0.1=51497,1=51909,2.5=51909 1529948620000000000

But I don’t care about counts, I care about 99th percentile. In prometheus I can calculate this with histogram_quantile function. But in influx?

My questions:

  1. is there an easy way to reproduce histogram_quantile in influx?
  2. or maybe there is a way to make telegraf calculate proper quantiles and sent them to influx?

Thanks!

Hello mabn,
Is this histogram telegraf pluggin useful to you?:

Best,

Anais

Unfortunately, if I understand correctly, this plugin does something opposite.

It takes a metric’s field as an input and creates multiple buckets. I need a reverse transformation.

Has anyone found a solution for this? Not much value in storing the histogram data if you can’t get Influx to use it to calculate the quantiles.

Given this – https://docs.influxdata.com/flux/v0.7/functions/transformations/aggregates/histogramquantile/ – I’m going to guess that the answer will be “use Flux” (though it isn’t clear that’s a real option for production right now).