How to build histogram from raw statsd data in Telegraf

Is there a way to make telegraf consume raw statsd data instead of raw aggregate data?

I am trying to build a histogram for statsd timing based on raw data, but telegraf calculates the histogram data buckets based on aggregated data (mean, upper, lower, stddev, count, sum). How to configure telegraf to calculate the histogram based on the original raw data?

I’m trying to build a histogram for statsd timing (), but telegraf’s histogram calculates histogram data buckets not from raw data which were sent to statsd, but from aggregated by statsd(mean, upper, lower, stddev, count, sum). How to configure telegraf in a way to calculate histogram from origin data?

If we will add to histograms configs next lines

[[aggregators.histogram.config]]
         buckets = [30.0, 150.0, 300.0]
         measurement_name = "myMetric"

and fire this cli command once per second, changing values in some range from 0 to 400

echo -n "myMetric:131|ms" > /dev/udp/localhost/8125

after that we can check output via prometheus UI and see next results

myMetric_count_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="+Inf",metric_type="timing"}    37
myMetric_count_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="150",metric_type="timing"}    37
myMetric_count_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="30",metric_type="timing"}    37
myMetric_count_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="300",metric_type="timing"}    37
myMetric_lower_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="+Inf",metric_type="timing"}    37
myMetric_lower_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="150",metric_type="timing"}    6
myMetric_lower_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="30",metric_type="timing"}    9
myMetric_lower_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="300",metric_type="timing"}    2
myMetric_mean_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="+Inf",metric_type="timing"}    37
myMetric_mean_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="150",metric_type="timing"}    5
myMetric_mean_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="30",metric_type="timing"}    6
myMetric_mean_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="300",metric_type="timing"}    1
myMetric_stddev_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="+Inf",metric_type="timing"}    37
myMetric_stddev_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="150",metric_type="timing"}    37
myMetric_stddev_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="30",metric_type="timing"}    37
myMetric_stddev_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="300",metric_type="timing"}    37
myMetric_sum_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="+Inf",metric_type="timing"}    37
myMetric_sum_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="150",metric_type="timing"}    0
myMetric_sum_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="30",metric_type="timing"}    0
myMetric_sum_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="300",metric_type="timing"}    0
myMetric_upper_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="+Inf",metric_type="timing"}    37
myMetric_upper_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="150",metric_type="timing"}    5
myMetric_upper_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="30",metric_type="timing"}    1
myMetric_upper_bucket{host="ip-10-81-118-85",instance="localhost:9272",job="VCO_app",le="300",metric_type="timing"}    10

As we can see only aggregated values are put in buckets…

I tried the histogram metric type, and my results were equal to the timing metric types you can see above.

I also tried gauges, but results were confusing too. When I configured telegraf’s histogram to gauge, only the latest data point per observation period were taken into account.

So, is there any way to configure the statsd input and histograms in telegraf to calculate histograms based on raw input data?

Unfortunately, it’s not possible to do this currently, the statsd parser and aggregation are combined together.