-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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 box plot panels #3227
Comments
+1 for this feature request |
+1 |
+1 This would be a great addition. |
+1 would love this for showing perf test results |
+1 |
7 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
I would think a box plot would require a new panel. Stealing this information from Netuative For example if you are running a virtual environment and want to see which vm's are over specced a dashboard showing memory usage of all vm's as boxplots would be extremely helpful. |
So is Grafana supporting box-plot now? (I don't think so..) |
@tcloaa no, there is no box-plot plugin/panel. It looks interesting but is not on the road map for this year. |
@torkelo is there a good example of using heatmaps with graphite (statsd histograms?), struggling to find a working setup, but your screenshot suggests its possible. |
@daniellee I am planning to do some hackaton this Easter and try to implement the box plot as a single-stat panel. If here is the correct way: (if not I will repeat the questions on discuss)
|
@paurullan here or community site is fine. Sorry I missed answering this - how did your hackathon go? I would say that it would be a lot faster to use the plotly box plot so I would start there and test how well it works. If you are using plotly, then it looks like all you have to do it is to give a box plot the data. Your job would be map the aggregated data to a box plot and then figure out which options you would like to add (units, colors etc.). Or are you planning on showing multiple box plots? Maybe a box plot per hour for example? |
@daniellee I worked on it and managed to load data on a boxplot. The styling was very complicated and did not get anywhere. If anybody wants to work on it, the only thing to activate the box plot in the end was to add it on the plugin list: settings: {
type: 'scatter', |
👍 |
+1 for this request |
1 similar comment
+1 for this request |
+1 for this request, it may be very usefull for displaying perf test trend over runs, especially with a tool like gatling.io |
+1 for this request. |
+1 for this request |
Very useful feature. +1 |
|
1 for this feature |
I've approximated a boxplot using built-in options. It's a few steps, but works for me. I'm sharing here because this is where I stumbled upon when looking for how to do this... Not sure the easiest way to share the queries and panel setups, but I'll paste them below. Generally speaking,
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 8,
"links": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": true
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": [
{
"matcher": {
"id": "byFrameRefID",
"options": "D"
},
"properties": [
{
"id": "custom.drawStyle",
"value": "points"
}
]
},
{
"matcher": {
"id": "byFrameRefID",
"options": "E"
},
"properties": [
{
"id": "custom.drawStyle",
"value": "points"
}
]
},
{
"matcher": {
"id": "byFrameRefID",
"options": "A"
},
"properties": [
{
"id": "custom.fillBelowTo",
"value": "10% ptile"
}
]
},
{
"matcher": {
"id": "byFrameRefID",
"options": "B"
},
"properties": [
{
"id": "custom.fillBelowTo",
"value": "10% ptile"
}
]
},
{
"matcher": {
"id": "byFrameRefID",
"options": "C"
},
"properties": [
{
"id": "custom.fillBelowTo",
"value": "50% ptile"
}
]
}
]
},
"gridPos": {
"h": 16,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"interval": "12h",
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltipOptions": {
"mode": "multi"
}
},
"pluginVersion": "7.5.1",
"targets": [
{
"alias": "min",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"hide": false,
"measurement": "W",
"orderByTime": "ASC",
"policy": "default",
"refId": "D",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "min"
}
]
],
"tags": [
{
"key": "entity_id",
"operator": "=",
"value": "envoy_current_energy_consumption"
}
]
},
{
"alias": "10% ptile",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"measurement": "W",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [
"10"
],
"type": "percentile"
}
]
],
"tags": [
{
"key": "entity_id",
"operator": "=",
"value": "envoy_current_energy_consumption"
}
]
},
{
"alias": "50% ptile",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"hide": false,
"measurement": "W",
"orderByTime": "ASC",
"policy": "default",
"refId": "B",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [
"50"
],
"type": "percentile"
}
]
],
"tags": [
{
"key": "entity_id",
"operator": "=",
"value": "envoy_current_energy_consumption"
}
]
},
{
"alias": "90% ptile",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"hide": false,
"measurement": "W",
"orderByTime": "ASC",
"policy": "default",
"refId": "C",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [
"90"
],
"type": "percentile"
}
]
],
"tags": [
{
"key": "entity_id",
"operator": "=",
"value": "envoy_current_energy_consumption"
}
]
},
{
"alias": "max",
"groupBy": [
{
"params": [
"$__interval"
],
"type": "time"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"hide": false,
"measurement": "W",
"orderByTime": "ASC",
"policy": "default",
"refId": "E",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "max"
}
]
],
"tags": [
{
"key": "entity_id",
"operator": "=",
"value": "envoy_current_energy_consumption"
}
]
}
],
"timeFrom": null,
"title": "Power Consumption - Boxplots",
"type": "timeseries"
}
],
"schemaVersion": 27,
"style": "dark",
"tags": [
"power"
],
"templating": {
"list": []
},
"time": {
"from": "now-7d",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Power - Percentiles",
"uid": "u02ThGlGz",
"version": 20
} |
Is there any plugin that supports this now? |
yep, it's coming ;) i'm currently working on a candlestick/financial panel and then migrating/rewriting the Heatmap panel to uPlot. box/whisker will likely be after that. maybe someone else will pick up the work sooner. eta is a few more point releases. |
In the meantime, the current Candlestick panel can be used to mimic box plots. Beware, it's a bit hacky. What works:
What's missing:
Here's an example of how we managed to put that together (with demo data): |
Violin plot might be even better than box plot pannels : |
Still relevant |
@HogeBlekker How to detect outliers in box plot? Thanks |
@phutoan31299 the idea behind box plots is that median, lower quartile and upper quartile are stable against outliers. I.e. a big delta between max and upper quartile, and min and lower quartile, indicates outliers. |
this works with plotty panel grafana plugin https://community.grafana.com/t/how-to-use-plotly-panel-in-grafana/87948/2 |
After searching if Grafana has support for box plots, I first found this issue and after some more search I found that a newer and still maintained version of Plotly(https://github.com/nline/nline-plotlyjs-panel) is able to do them and there is also a good explanation on how to: https://plotly.com/javascript/box-plots/ |
@tobiasfalk check this one out |
candlestick supports this |
i think candlestick doesnt support this well. we should add logic to calc the stats over a defined window in the ui as well. also need to draw means/medians in the boxes as well as T-shaped box whiskers for quartiles and maybe draw outliers. it has some way to go, still. |
Wanted to chime in and say this is the one feature missing from Grafana for me. I spent hours trying to recreate it with candlesticks but ultimately failed. Sometimes it works OK for time series data, but brittle. What I’d really love to see is a “stat” version of box plot, to compare percentiles of things (without time series). That would be incredibly useful. |
@ianks What exactly do you mean by "stat" version? I still have a private boxplot plugin based on plotly boxplots. But since there was no real interest / support I lost interest working on it. |
This may be a bit unconventional for typical time series display, but I think it could be very valuable.
Right now I emulate this by drawing a time series panel with line graphs with different percentiles. Together they provide information similar to that of a heat map.
And for better insight into data that has daily and weekly patterns, time series overlay help a lot to identify changes in data that always go up and down, but then you can compare it to how it was yesterday, and how it was the same day last week.
I think box plots would better serve some of these cases. It does have the obvious draw back of flattening the "time" part of "time series", but one could render multiple ones. E.g. One for last 24 hours, and one for the 24 hours before that, similar to Graphite
summarize(24h)
.Example box plot from https://codeascraft.com/2015/11/10/q3-2015-site-performance-report/
The text was updated successfully, but these errors were encountered: