How can I visualize a histogram with Promdash or Grafana?

后端 未结 4 744
花落未央
花落未央 2021-02-05 02:42

I\'m attracted to prometheus by the histogram (and summaries) time-series, but I\'ve been unsuccessful to display a histogram in either promdash or grafana. What I expect is to

4条回答
  •  不知归路
    2021-02-05 03:06

    Grafana v5+ provides direct support for representing Prometheus histograms as heatmap. http://docs.grafana.org/features/panels/heatmap/#histograms-and-buckets

    Heatmaps are preferred over histogram because a histogram does not show you how the trend changes over time. So if you have a time-series histogram, then use the heatmap panel to picture it.

    To get you started, here is an example (for Prometheus data):

    Suppose you've a histogram as follows,

    http_request_duration_seconds_bucket(le=0.2) 1,
    http_request_duration_seconds_bucket(le=0.5) 2,
    http_request_duration_seconds_bucket(le=1.0) 2,
    http_request_duration_seconds_bucket(le=+inf) 5
    http_request_duration_seconds_count 5
    http_request_duration_seconds_sum 3.07
    

    You can picture this histogram data as a heatmap by using the query: sum(increase(http_request_duration_seconds_bucket[10m])) by (le), making sure to set the format as "heatmap," the legend format as {{ le }}, and setting the visualization in the panel settings to "heatmap."

提交回复
热议问题