envoyproxy/envoy

prometheus metric exporter ignores units

Open

#15,768 建立於 2021年3月30日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)C++ (5,373 fork)batch import
area/statshelp wanted

倉庫指標

Star
 (27,997 star)
PR 合併指標
 (平均合併 8天) (30 天內合併 378 個 PR)

描述

The current exporter

   double bucket = supported_buckets[i];
    uint64_t value = computed_buckets[i];
...
    output.append(fmt::format("{0}_bucket{{{1}le=\"{2:.32g}\"}} {3}\n", prefixed_tag_extracted_name,
                              hist_tags, bucket, value));

outputs the bucket name without consideration for the units. However Prometheus has strong conventions for metrics which require the metric to be in base units. That is a time metric should have values comprised of seconds, not milliseconds or microseconds.

This is important as it allows timeseries operations between metrics from disparate sources without normalisation transformations scattered all over the place.

Prometheus should be normalising the sum and le fields for Microseconds and Milliseconds unit histograms into Seconds on output in the Prometheus exporter (and I think I read that the GRPC exporter is a separate codepath, so there too).

Repro steps:

Request a prometheus stats page from Envoy, and an internal stats page from a microservice, and try to compare time statistics between them.

I recognise that there are backwards compatibility considerations here, so perhaps an opt-out to allow organisations without other datasources and a strong investment solely in Envoy metrics would be a good idea.

貢獻者指南