In the latest release of InfluxDB2, I am able to create a prometheus-like histogram over a Telegraf metric (i.e. cpu system usage) by running the histogram function with a set of bins over it. By default, the upper bound column will be called “le”, and will be of type double. I can then calculate quantiles over this histogram by using the histogramQuantile function.
I want to do the same with metrics scraped by the in-built Prometheus scraper, that scrapes it’s data from an endpoint created with the official Python Prometheus client. The histograms created by that scraper have a _field column with the upper bound bin values, however, this column is of type string. This means using the _field column as upper bound column in the histogramQuantile function does not work because of incompatible types.
The toFloat function can only be used to map a type conversion over the _value column of a record set, so that’s no option either. So my question is, is it currently possible to use histogramQuantiles over scraped Prometheus metrics and how ?