Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for histograms #600

Closed
jcellary opened this Issue Jul 17, 2014 · 64 comments

Comments

Projects
None yet
@jcellary
Copy link

jcellary commented Jul 17, 2014

It would be very useful to have histograms displayed

Example:

histogram

@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Jul 29, 2014

Yes this is definitely something I want to do!

@sahilthapar

This comment has been minimized.

Copy link

sahilthapar commented Jul 30, 2014

+1

@jcellary

This comment has been minimized.

Copy link
Author

jcellary commented Jul 30, 2014

Actually after giving more though to it the histogram I pasted in before doesn't make much sense since we are displaying data in time, so the chart needs to reflect that. So the diagram could look like this:

http://fastly.github.io/epoch/real-time/#heatmap

Actually it might be even possible to use the linked code in Grafana.

fastly com analytics wikia

Is this item on the roadmap for the nearest future? Just asking if we should expect it any time soon :)

Thanks!

@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Jul 30, 2014

well I think the histogram is nice as well (to see the distribution of values over a time period). The heatmap is also nice, but the question is how to fetch the data for it, since I need all values for each time point.

@XANi

This comment has been minimized.

Copy link

XANi commented Jul 30, 2014

InfluxDB have histogram function

select histogram(value, bucket_size) from dataseries

and if you group by time you will get histogram for each period, effectively from sth like

select histogram(value) from /dc1.es1.ipmi.temperature.Ambient_Temp_front_panel_board.*/ where time > now() - 22h group by time(10m)

you get

|          time | bucket_start | count |
|---------------+--------------+-------|
| 1406728800000 |           18 |     1 |
| 1406728200000 |           17 |     3 |
| 1406728200000 |           18 |     9 |
| 1406728200000 |           19 |    11 |
| 1406728200000 |           20 |     7 |
| 1406728200000 |           21 |     9 |
| 1406728200000 |           22 |    16 |
| 1406728200000 |           23 |     5 |
| 1406727600000 |           23 |     3 |
| 1406727600000 |           22 |    42 |
| 1406727600000 |           21 |    15 |
| 1406727000000 |           21 |    12 |
| 1406727000000 |           20 |    17 |
| 1406727000000 |           19 |    11 |
| 1406727000000 |           18 |    15 |
| 1406727000000 |           17 |     5 |
| 1406726400000 |           17 |     8 |
| 1406726400000 |           18 |    12 |
| 1406726400000 |           19 |    10 |
| 1406726400000 |           20 |     9 |
| 1406726400000 |           21 |     7 |
| 1406726400000 |           22 |     9 |
| 1406726400000 |           23 |     5 |
| 1406725800000 |           22 |    51 |
| 1406725800000 |           23 |     9 |

which can be mapped:

time - X axis
bucket_start - Y axis
count - Z axis (intensity of color, or place in color palette)

effectively resulting in heat map

@xinuc

This comment has been minimized.

Copy link

xinuc commented Aug 10, 2014

👍 for this. At least we can support histogram for influxdb, if the other backends cannot support it.

@aybabtme

This comment has been minimized.

Copy link

aybabtme commented Sep 23, 2014

heatmaps would be awesome, very much needed

@mschenck

This comment has been minimized.

Copy link

mschenck commented Sep 23, 2014

👍

@Dieterbe

This comment has been minimized.

Copy link
Contributor

Dieterbe commented Oct 9, 2014

+1 for both histogram for all data across entire timerange, as well as
+1 for histogram over time (buckets for small time intervals, rendered in heatmap)

!!! thanks :D

@Dieterbe

This comment has been minimized.

Copy link
Contributor

Dieterbe commented Oct 9, 2014

for this. At least we can support histogram for influxdb, if the other backends cannot support it.

actually you can do histograms over time with graphite too. if you use for example statsd then you have your data in a metric per bin (see https://github.com/etsy/statsd/blob/master/docs/metric_types.md) so you have metric.bin_50, metric.bin_inf, so you could put that in a heatmap.
(note, i don't think many people actually use this statsd feature)

to get a single histogram for an entire timerange in graphite, we could do the binning in js :)

@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Oct 9, 2014

@Dieterbe true, what I have never understood through is the percentile functions in graphite, never understood how they work or if they work. What would be nice is being able to use the summarize graphite function with a percentile function, like summarize(my.high.resolution.metric, '1h', "percentiles 0.9 0.95")

woodsaj added a commit to raintank/grafana that referenced this issue Oct 16, 2014

johann8384 added a commit to johann8384/grafana that referenced this issue Nov 5, 2014

@biancalana

This comment has been minimized.

Copy link

biancalana commented Nov 14, 2014

+1

2 similar comments
@jeromegit

This comment has been minimized.

Copy link

jeromegit commented Nov 27, 2014

+1

@cambridgemike

This comment has been minimized.

Copy link

cambridgemike commented Nov 30, 2014

+1

@cypreess

This comment has been minimized.

Copy link

cypreess commented Jan 5, 2015

+1 for both

@fsauer65

This comment has been minimized.

Copy link

fsauer65 commented Jan 29, 2015

++ 1

also this would be an aswesome way to visualize a percentiles "histogram": http://hdrhistogram.github.io/HdrHistogram/plotFiles.html

@gsaray101

This comment has been minimized.

Copy link

gsaray101 commented Feb 6, 2015

+1

3 similar comments
@vitillo

This comment has been minimized.

Copy link

vitillo commented Mar 12, 2015

+1

@jheusser

This comment has been minimized.

Copy link

jheusser commented Mar 19, 2015

+1

@MalteJ

This comment has been minimized.

Copy link

MalteJ commented Mar 19, 2015

+1

@makapuf

This comment has been minimized.

Copy link

makapuf commented Apr 10, 2015

+1 !

@jmorlock

This comment has been minimized.

Copy link

jmorlock commented Apr 16, 2015

+1

@jessetan

This comment has been minimized.

Copy link

jessetan commented Apr 7, 2016

What would be the preferred way to support histograms in Grafana?
The PR in #949 (which @bergquist mentioned may be eligible for inclusion pending merging in master and adding tests) can be ported to the latest version. I've gone so far as to verify it actually works, no tests yet and some minor UI issues. Since there is quite some overlap with the other graph code, this would make sense.
On the other hand, a histogram is a totally different type of graph and can not be mixed with existing graph types (lines, points, bars). So a separate plugin would be more logical then (similar to the piechart plugin). @mtanda already did work on this, but it is not compatible with the plugin API in 3.0

@XANi

This comment has been minimized.

Copy link

XANi commented Apr 7, 2016

IMO the only case where it would make sense to have it in same "type" would be if you could say have "normal" over time data on one layer and histogram on other, to basically have histogram bars as bacground with over-time data in foreground. If that way is not supported it doesn't really make sense to put it in same place.

Especially that over time "histogram plugin" could be expanded to do "histogram over time"/heatmap visualisations

@jessetan

This comment has been minimized.

Copy link

jessetan commented Apr 7, 2016

A "histogram over time" / heatmap is possible and would make sense to put in the graph panel, but a "regular" histogram can not be combined with other graph types since the x-axis shows buckets, not time.

@mtanda

This comment has been minimized.

Copy link
Collaborator

mtanda commented Apr 12, 2016

Hi, I try to support Grafana 3.0.
I don't test it well, but it seems to work.
https://github.com/mtanda/grafana-panel-plugin-histogram

I extend GraphCtrl class, and add HistogramCtrl. So, some part of code is shared with graph panel.

@jessetan

This comment has been minimized.

Copy link

jessetan commented Apr 14, 2016

@mtanda great, this is easier than patching the code myself ;)
I'll file any issues I see to your repo, I don't think it is ready for grafana.net yet. But once it is, I think this issue can be closed.

@mtanda

This comment has been minimized.

Copy link
Collaborator

mtanda commented Apr 14, 2016

@jessetan Thanks! I'm waiting for your feedback.

@hgfischer

This comment has been minimized.

Copy link

hgfischer commented Apr 14, 2016

This issue seems abandoned by the Grafana team.

@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Apr 14, 2016

@hgfischer in what way? not sure we have promised this :)

@mtanda

This comment has been minimized.

Copy link
Collaborator

mtanda commented May 9, 2016

I'm working on heatmap panel too.
https://github.com/mtanda/grafana-heatmap-epoch-panel
Currently, it doesn't support InfluxDB/Elasticsearch histogram response.

If #3164 is implemented, the panel becomes more useful.

@johnou

This comment has been minimized.

Copy link
Contributor

johnou commented Jun 19, 2016

@mtanda would you please attach some sample screenshots of the histogram and heat map plugin panels?

@mtanda

This comment has been minimized.

Copy link
Collaborator

mtanda commented Jun 20, 2016

@johnou These are screenshots. I notice there are some bugs in query editor, but other part works well.

Histogram:
histogram

Heatmap:
heatmap

@LuboVarga

This comment has been minimized.

Copy link
Contributor

LuboVarga commented Jul 18, 2016

+1

@WIZARD-CXY

This comment has been minimized.

Copy link

WIZARD-CXY commented Aug 24, 2016

+1

3 similar comments
@cederigo

This comment has been minimized.

Copy link
Contributor

cederigo commented Sep 1, 2016

+1

@cattt84

This comment has been minimized.

Copy link

cattt84 commented Nov 11, 2016

+1

@GillesBIANNIC

This comment has been minimized.

Copy link

GillesBIANNIC commented Jan 3, 2017

+1

@felixge

This comment has been minimized.

Copy link

felixge commented Jan 23, 2017

@mtanda your heatmap plugin looks great. I hope to be able to try it out soon. Also +1 for something similar to be included in grafana core.

@torkelo torkelo added this to the 4.3.0 milestone Apr 3, 2017

alexanderzobnin added a commit to alexanderzobnin/grafana that referenced this issue Apr 6, 2017

torkelo added a commit that referenced this issue Apr 7, 2017

graph: initial histogram support #600 (#8053)
* graph: initial histogram support #600

* graph histogram mode: add Bars number option

* graph histogram mode: fix X axis ticks calculation

* graph histogram mode: change bar style (align and width)

* refactor(graph): move histogram functions into separate module

* graph histogram mode: rename series to "count"

* graph histogram mode: fix errors if no data

* refactor(graph and heatmap): move shared code into app/core

* graph: add tests for histogram mode

mtanda added a commit to mtanda/grafana that referenced this issue Apr 10, 2017

graph: initial histogram support grafana#600 (grafana#8053)
* graph: initial histogram support grafana#600

* graph histogram mode: add Bars number option

* graph histogram mode: fix X axis ticks calculation

* graph histogram mode: change bar style (align and width)

* refactor(graph): move histogram functions into separate module

* graph histogram mode: rename series to "count"

* graph histogram mode: fix errors if no data

* refactor(graph and heatmap): move shared code into app/core

* graph: add tests for histogram mode
@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Apr 11, 2017

histogram support added to main graph panel:

image

#8053

@torkelo torkelo closed this Apr 11, 2017

@Dieterbe

This comment has been minimized.

Copy link
Contributor

Dieterbe commented Apr 11, 2017

Wow so the same old graph panel can now do histograms ? That's even better then a separate panel. Thanks Alex and torkel

@Jan-Axoom

This comment has been minimized.

Copy link

Jan-Axoom commented Jan 4, 2018

I still have a problem using this new feature. I want to see the distribution of for example the run times of a certain function. For that I connected an elasticsearch source and filled it with the desired data. The thing is that the new function aggregates over the timestamp when the data was written and not, what would be more logical, over the displayed data. With the current state I have to choose an interval for the group by clause, so that no data points are combined. Otherwise the shown distribution is completely misleading.

(I tested min / max (used in the pictures) / average as metric, all of them are equally bad)
The following pictures involve run times from 100ms to 1000ms with interval set to 1. 100ms (how it should look), 2. 1s and 3. 10s (auto)
100ms
1s
auto

Auto-interval makes no sense here because the inspected time interval (here last 24 hours) can be changed, what will result in a whole other graph as well.

@alexanderzobnin

This comment has been minimized.

Copy link
Contributor

alexanderzobnin commented Mar 13, 2018

@Jan-Axoom could you please share your ES query? This mode just transform timeseries data to histogram. More source points make more precise result. But for ES and other datasources supporting histogram aggregation make more sense to use aggregated data like Heatmap panel does (#11087). We think about extracting histogram to the separate panel, so I think it would be a nice feature to have.

@mrdeveloperdude

This comment has been minimized.

Copy link

mrdeveloperdude commented Sep 14, 2018

I am trying to use this with MySQL but there is no documentation. (http://docs.grafana.org/features/datasources/mysql/)

How can I write my SQL to work with this feature?

Please shed some light!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.