Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-8946

Prometheus histograms do not follow conventions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Impala 3.3.0
    • Fix Version/s: Impala 3.4.0
    • Component/s: Backend
    • Labels:
    • Epic Color:
      ghx-label-2

      Description

      We've been using Prometheus metrics and we've found that some standard Prometheus parser can not properly interpret histograms from Impala.

      For example, Python official client (https://github.com/prometheus/client_python) can not properly read them. I've been digging a little bit why it can't read them and I've found that Impala does not adhere to textual histogram conventions.

      The following link describes the conventions for rendering histograms on Prometheus textual format: https://prometheus.io/docs/instrumenting/exposition_formats/#histograms-and-summaries

      This is an example of a rendered histogram on Impala 3.3 on Prometheus endpoint:

      # HELP impala_thrift_server_backend_svc_thread_wait_time Amount of time clients of Impala Backend Server spent waiting for service threads
      # TYPE impala_thrift_server_backend_svc_thread_wait_time histogram
      impala_thrift_server_backend_svc_thread_wait_time{le="0.2"} 0
      impala_thrift_server_backend_svc_thread_wait_time{le="0.5"} 0
      impala_thrift_server_backend_svc_thread_wait_time{le="0.7"} 0
      impala_thrift_server_backend_svc_thread_wait_time{le="0.9"} 0
      impala_thrift_server_backend_svc_thread_wait_time{le="0.95"} 0
      impala_thrift_server_backend_svc_thread_wait_time{le="0.999"} 0
      impala_thrift_server_backend_svc_thread_wait_time_max 0
      impala_thrift_server_backend_svc_thread_wait_time_min 0
      impala_thrift_server_backend_svc_thread_wait_time_count 49
      

      The linked histogram conventions say that

      Each bucket count of a histogram named x is given as a separate sample line with the name x_bucket and a label {le="y"} (where y is the upper bound of the bucket).

      And also

      A histogram must have a bucket with {le="+Inf"}. Its value must be identical to the value of x_count.

      The previous example should be formatted as:

      # HELP impala_thrift_server_backend_svc_thread_wait_time Amount of time clients of Impala Backend Server spent waiting for service threads
      # TYPE impala_thrift_server_backend_svc_thread_wait_time histogram
      impala_thrift_server_backend_svc_thread_wait_time_bucket{le="0.2"} 0
      impala_thrift_server_backend_svc_thread_wait_time_bucket{le="0.5"} 0
      impala_thrift_server_backend_svc_thread_wait_time_bucket{le="0.7"} 0
      impala_thrift_server_backend_svc_thread_wait_time_bucket{le="0.9"} 0
      impala_thrift_server_backend_svc_thread_wait_time_bucket{le="0.95"} 0
      impala_thrift_server_backend_svc_thread_wait_time_bucket{le="0.999"} 0
      impala_thrift_server_backend_svc_thread_wait_time_bucket{le="+Inf"} 49
      impala_thrift_server_backend_svc_thread_wait_time_count 49
      

      I've found that with this format, the official python client is able to properly read the histograms.

      Note also that metrics suffixed with `_min` and `_max` are also out of the convention and they also break histogram parsing and maybe they need to be reported as separated metrics (maybe as gauges?)

      If you are fine with doing this changes, I already have a patch to improve the histogram formatting and I can submit it to review.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                guillemnieto Guillem
                Reporter:
                guillemnieto Guillem
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: