diff --git a/src/cmt_decode_prometheus_remote_write.c b/src/cmt_decode_prometheus_remote_write.c index cbe394d..1a01f2d 100644 --- a/src/cmt_decode_prometheus_remote_write.c +++ b/src/cmt_decode_prometheus_remote_write.c @@ -515,6 +515,7 @@ static int decode_metrics_entry(struct cmt *cmt, void *instance; int result; int ts_count = 0; + int hist_count = 0; int meta_count = 0; Prometheus__MetricMetadata *metadata = NULL; Prometheus__MetricMetadata__MetricType type; @@ -526,6 +527,7 @@ static int decode_metrics_entry(struct cmt *cmt, for (i = 0; i < ts_count; i++) { ts = write->timeseries[i]; meta_count = write->n_metadata; + hist_count = ts->n_histograms; if (meta_count > 0) { metadata = write->metadata[i]; } @@ -533,6 +535,10 @@ static int decode_metrics_entry(struct cmt *cmt, type = PROMETHEUS__METRIC_METADATA__METRIC_TYPE__GAUGE; metric_description = "-"; } + else if (hist_count > 0) { + type = PROMETHEUS__METRIC_METADATA__METRIC_TYPE__HISTOGRAM; + metric_description = "-"; + } else { type = write->metadata[i]->type; metric_description = write->metadata[i]->help;