diff --git a/README.md b/README.md index 3aad853..cb72a94 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Gnocchi datasource for Grafana 3 and 4 +![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/collectd-dashboard.png) + ## Installation via grafana.net $ sudo grafana-cli plugins install gnocchixyz-gnocchi-datasource @@ -39,34 +41,16 @@ This works only if Access = Direct, and CORS is properly configured on Keystone Open a graph in edit mode by click the title. -The editor have 4 modes to retreives metrics, you can change the mode by clicking of the pencil on the right. - -* Measurements of a metric: - Create one graph with datapoint of the defined metric - - ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_query_mode1.png) - - Metric ID: the id of the metric you are interrested in +The editor have 4 modes to retrieves metrics: -* Measurements of metrics of resources: - Create one graph per metric find with the query. +* Dynamic aggregates (recommended way): + Create a *query* to select all resources you need. + Create an *operation* that select metric and do math on/between them. + Set *label* to name each graph with text or with resource attributes. - ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_query_mode3.png) + ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/grafana_dynamic.png) - Query: the query to search resources - Resource type: the type of the resource (generic, instance, disk, ...) - Metric name: the name of the metric - Label attribute: the label or the resource attribute to use as label. - -* Aggregated measurements of a metric across resources: - Create one graph with an aggregation of all datapoints of metrics that match the query. - - ![](https://raw.githubusercontent.com/gnocchixyz/grafana-gnocchi-datasource/master/docs/gnocchi_query_mode4.png) - - Query: the query to search resources - Resource type: the type of the resource (generic, instance, disk, ...) - Metric name: the name of the metric - Label attribute: the label or the resource attribute to use as label. +Other mode are mainly here old Gnocchi version that doesn't support *Dynamic aggregates* Each mode also have the aggregator method to use to get datapoints of the metrics. @@ -130,12 +114,10 @@ For details of `Query` format, please refer to the Gnocchi and Gnocchi client do ## Current Limitation Grafana doesn’t allow to query two different servers when using the proxy mode, -so we are not able to query Keystone for a token and then query gnocchi. - -In proxymode, we need to set a token and the Gnocchi URL on the datasource. +so we are not able to query Keystone for a token and then query Gnocchi (Except if +Gnocchi and Keystone live into the same HTTP host). -In direct mode, we can use login/password and the Keystone URL. -Note that CORS MUST be enabled on Keystone and Gnocchi servers. +In direct mode, CORS MUST be enabled on Keystone and Gnocchi servers. ## License diff --git a/docs/collectd-dashboard.png b/docs/collectd-dashboard.png new file mode 100644 index 0000000..c2c07af Binary files /dev/null and b/docs/collectd-dashboard.png differ diff --git a/docs/example_dashboard.json b/docs/example_dashboard.json deleted file mode 100644 index 6643f6e..0000000 --- a/docs/example_dashboard.json +++ /dev/null @@ -1,995 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_GNOCCHI_ADMIN", - "label": "Gnocchi_Admin", - "description": "", - "type": "datasource", - "pluginId": "gnocchixyz-gnocchi-datasource", - "pluginName": "Gnocchi" - } - ], - "__requires": [ - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "3.1.1" - }, - { - "type": "datasource", - "id": "gnocchixyz-gnocchi-datasource", - "name": "Gnocchi", - "version": "1.0.9" - } - ], - "id": null, - "title": "Example Dashboard", - "tags": [], - "style": "dark", - "timezone": "browser", - "editable": true, - "hideControls": false, - "sharedCrosshair": true, - "rows": [ - { - "collapse": false, - "editable": true, - "height": "300px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 3, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "hideZero": false, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "display_name", - "metric_name": "cpu_util", - "queryMode": "resource_search", - "refId": "A", - "resource_id": "", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "CPU Util (All VMs)", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "short", - "label": "% CPU Util", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": "", - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - } - ], - "title": "New row" - }, - { - "collapse": false, - "editable": true, - "height": "250px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)", - "thresholdLine": false - }, - "id": 4, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "display_name", - "metric_name": "memory.usage", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Memory Usage", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "mbytes", - "label": "Memory", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - } - ], - "title": "New row" - }, - { - "collapse": false, - "editable": true, - "height": "250px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 10, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "hideZero": false, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "instance_id", - "metric_name": "disk.device.write.bytes.rate", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance_disk", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Disk Device Write Bytes Rate", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "Bps", - "label": "Disk Output / Second", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - }, - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 8, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "hideZero": false, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "instance_id", - "metric_name": "disk.device.write.bytes", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance_disk", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Disk Device Write Bytes (Cumulative)", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "bytes", - "label": "Disk Write", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - } - ], - "title": "New row" - }, - { - "collapse": false, - "editable": true, - "height": "250px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 11, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "instance_id", - "metric_name": "disk.device.read.bytes.rate", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance_disk", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Disk Device Read Bytes Rate", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "Bps", - "label": "Disk Read / Sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - }, - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 9, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "instance_id", - "metric_name": "disk.device.read.bytes", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance_disk", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Disk Device Read Bytes (Cumulative)", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "bytes", - "label": "Disk Read ", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - } - ], - "title": "New row" - }, - { - "collapse": false, - "editable": true, - "height": "250px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 12, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "instance_id", - "metric_name": "network.outgoing.bytes.rate", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance_network_interface", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Network Outgoing Bytes Rate", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "Bps", - "label": "Network Out / Sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - }, - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 5, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "instance_id", - "metric_name": "network.outgoing.bytes", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance_network_interface", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Network Outgoing Bytes (Cumulative)", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "bytes", - "label": "Network Out", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - } - ], - "title": "New row" - }, - { - "collapse": false, - "editable": true, - "height": "250px", - "panels": [ - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 13, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "instance_id", - "metric_name": "network.incoming.bytes.rate", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance_network_interface", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Network Incoming Bytes Rate", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "Bps", - "label": "Network In / Sec", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - }, - { - "aliasColors": {}, - "bars": false, - "datasource": "${DS_GNOCCHI_ADMIN}", - "editable": true, - "error": false, - "fill": 1, - "grid": { - "threshold1": null, - "threshold1Color": "rgba(216, 200, 27, 0.27)", - "threshold2": null, - "threshold2Color": "rgba(234, 112, 112, 0.22)" - }, - "id": 6, - "isNew": true, - "legend": { - "alignAsTable": true, - "avg": false, - "current": false, - "hideEmpty": true, - "max": false, - "min": false, - "rightSide": true, - "show": true, - "total": false, - "values": false, - "sideWidth": 400 - }, - "lines": true, - "linewidth": 2, - "links": [], - "nullPointMode": "connected", - "percentage": false, - "pointradius": 5, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "span": 12, - "stack": false, - "steppedLine": false, - "targets": [ - { - "aggregator": "mean", - "hide": false, - "label": "instance_id", - "metric_name": "network.incoming.bytes", - "queryMode": "resource_search", - "refId": "A", - "resource_search": "original_resource_id like '%'", - "resource_type": "instance_network_interface", - "validQuery": true - } - ], - "timeFrom": null, - "timeShift": null, - "title": "Network Incoming Bytes (Cumulative)", - "tooltip": { - "msResolution": true, - "shared": true, - "sort": 0, - "value_type": "cumulative" - }, - "type": "graph", - "xaxis": { - "show": true - }, - "yaxes": [ - { - "format": "bytes", - "label": "Network In", - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "decimals": null - } - ], - "title": "New row" - } - ], - "time": { - "from": "now-12h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "5s", - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": [ - "5m", - "15m", - "1h", - "6h", - "12h", - "24h", - "2d", - "7d", - "30d" - ] - }, - "templating": { - "list": [] - }, - "annotations": { - "list": [] - }, - "refresh": false, - "schemaVersion": 12, - "version": 68, - "links": [], - "gnetId": null -} diff --git a/docs/example_dashboard_Screenshot.png b/docs/example_dashboard_Screenshot.png deleted file mode 100644 index 01db0a5..0000000 Binary files a/docs/example_dashboard_Screenshot.png and /dev/null differ diff --git a/docs/grafana-dynamic.png b/docs/grafana-dynamic.png new file mode 100644 index 0000000..f67446d Binary files /dev/null and b/docs/grafana-dynamic.png differ diff --git a/docs/grafana-metric-id.png b/docs/grafana-metric-id.png new file mode 100644 index 0000000..8a036df Binary files /dev/null and b/docs/grafana-metric-id.png differ