diff --git a/README.md b/README.md index f4d248a..4753527 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,19 @@ This data source plugin allows you to query and visualize log data stored in Par - Push the `Save and Test` button, if there is an error message, check the credentials and connection. -![data source config](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/configuration.png?raw=true) + ## Usage Once the plugin is configured with correct Parseable server instance. You can start using it to query logs and visualize them. You can use the query editor to write your own queries. +### Importing Dashboards + +This plugin has a a pre-made dashboard called "Parseable Demo Data". You can find it by navigating to the data sources configuration page, selecting the Parseable data source and clicking on the Dashboards tab. + +This dashboard is aimed at visualizing the logs stored in the Parseable demo server. You can use it as a starting point for your own dashboards. To use this dashboard, you will need to configure the data source with the Parseable demo server URL https://demo.parseable.io and credentials parseable, parseable. + ## Screenshots -![log explorer](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/logs.png?raw=true) -![failure rate](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/dashboard.png?raw=true) +![log dashboard](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/log-visualisation.png?raw=true) +![log text view](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/log-view-text.png?raw=true) diff --git a/dist/README.md b/dist/README.md index f4d248a..730a8df 100644 --- a/dist/README.md +++ b/dist/README.md @@ -24,5 +24,5 @@ Once the plugin is configured with correct Parseable server instance. You can st ## Screenshots -![log explorer](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/logs.png?raw=true) -![failure rate](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/dashboard.png?raw=true) +![log dashboard](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/log-visualisation.png?raw=true) +![log text view](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/log-view-text.png?raw=true) diff --git a/dist/plugin.json b/dist/plugin.json index e73f3ec..99320d1 100644 --- a/dist/plugin.json +++ b/dist/plugin.json @@ -20,8 +20,8 @@ ], "screenshots": [ {"name": "Query Configuration", "path": "img/configuration.png"}, - {"name": "Log Explorer", "path": "img/logs.png"}, - {"name": "Log Dashboard", "path": "img/dashboard.png"} + {"name": "Log Explorer", "path": "img/log-view-text.png"}, + {"name": "Log Dashboard", "path": "img/log-visualisation.png"} ], "version": "1.0.0", "updated": "2023-01-04" diff --git a/src/README.md b/src/README.md index f4d248a..730a8df 100644 --- a/src/README.md +++ b/src/README.md @@ -24,5 +24,5 @@ Once the plugin is configured with correct Parseable server instance. You can st ## Screenshots -![log explorer](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/logs.png?raw=true) -![failure rate](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/dashboard.png?raw=true) +![log dashboard](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/log-visualisation.png?raw=true) +![log text view](https://github.com/parseablehq/parseable-datasource/blob/main/src/img/log-view-text.png?raw=true) diff --git a/src/dashboards/log-view.json b/src/dashboards/log-view.json new file mode 100644 index 0000000..d912939 --- /dev/null +++ b/src/dashboards/log-view.json @@ -0,0 +1,866 @@ +{ + "__inputs": [ + { + "name": "DS_PARSEABLE", + "label": "Parseable", + "description": "", + "type": "datasource", + "pluginId": "parseable-datasource", + "pluginName": "Parseable" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "barchart", + "name": "Bar chart", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "9.3.2" + }, + { + "type": "panel", + "id": "logs", + "name": "Logs", + "version": "" + }, + { + "type": "datasource", + "id": "parseable-datasource", + "name": "Parseable", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 10, + "panels": [], + "title": "Textual View", + "type": "row" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "left", + "displayMode": "color-text", + "filterable": true, + "inspect": true + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "status" + }, + "properties": [ + { + "id": "custom.width", + "value": 87 + } + ] + } + ] + }, + "gridPos": { + "h": 17, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 8, + "options": { + "footer": { + "enablePagination": true, + "fields": [ + "status" + ], + "reducer": [ + "count" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "queryText": "select * from frontend", + "refId": "A" + } + ], + "title": "Log Data", + "type": "table" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 29, + "options": { + "dedupStrategy": "none", + "enableLogDetails": true, + "prettifyLogMessage": true, + "showCommonLabels": false, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "pluginVersion": "9.3.2", + "targets": [ + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "queryText": "select * from frontend", + "refId": "A" + } + ], + "title": "Log View", + "transformations": [], + "type": "logs" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 12, + "panels": [], + "title": "Graphical View", + "type": "row" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisGridShow": true, + "axisLabel": "", + "axisPlacement": "left", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 29 + }, + "id": 21, + "options": { + "barRadius": 0, + "barWidth": 0.55, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "orientation": "auto", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "multi", + "sort": "asc" + }, + "xField": "datetime", + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "targets": [ + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as Successes from frontend where status ='200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "A" + } + ], + "title": "API Success Rate / Second", + "type": "barchart" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "red", + "mode": "fixed" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisGridShow": true, + "axisLabel": "", + "axisPlacement": "left", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 29 + }, + "id": 30, + "options": { + "barRadius": 0, + "barWidth": 0.55, + "groupWidth": 0.7, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "orientation": "auto", + "showValue": "always", + "stacking": "none", + "tooltip": { + "mode": "multi", + "sort": "asc" + }, + "xField": "datetime", + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "targets": [ + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as Successes from frontend where status <> '200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "A" + } + ], + "title": "API Failure Rate / Second", + "type": "barchart" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "post_failures" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "post_successes" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "delete_failures" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "put_failures" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "get_failures" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "put_successes" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "get_successes" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "delete_successes" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#3274D9", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 37 + }, + "id": 27, + "options": { + "barRadius": 0, + "barWidth": 0.69, + "groupWidth": 0.98, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "targets": [ + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as POST_successes from frontend where method='POST' and status ='200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "A" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "hide": false, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as PUT_successes from frontend where method='PUT' and status ='200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "B" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "hide": false, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as GET_successes from frontend where method='GET' and status ='200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "C" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "hide": false, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as DELETE_successes from frontend where method='DELETE' and status ='200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "D" + } + ], + "title": "API Success Rate / Method / Second", + "type": "barchart" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1, + "scaleDistribution": { + "type": "linear" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "post_failures" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "post_successes" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "delete_failures" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "put_failures" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "get_failures" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "delete_failures" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 37 + }, + "id": 25, + "options": { + "barRadius": 0, + "barWidth": 0.69, + "groupWidth": 0.98, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "orientation": "auto", + "showValue": "auto", + "stacking": "none", + "tooltip": { + "mode": "single", + "sort": "none" + }, + "xTickLabelRotation": 0, + "xTickLabelSpacing": 100 + }, + "targets": [ + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as POST_failures from frontend where method='POST' and status <>'200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "A" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "hide": false, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as PUT_failures from frontend where method='PUT' and status <>'200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "B" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "hide": false, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as GET_failures from frontend where method='GET' and status <>'200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "C" + }, + { + "datasource": { + "type": "parseable-datasource", + "uid": "${DS_PARSEABLE}" + }, + "hide": false, + "queryText": "select date_trunc('second',CAST(datetime AS Timestamp)) as datetime, count(*) as DELETE_failures from frontend where method='DELETE' and status <>'200' group by date_trunc('second',CAST(datetime AS Timestamp))", + "refId": "D" + } + ], + "title": "API Failure Rate / Method / Second", + "type": "barchart" + } + ], + "refresh": "1m", + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Parseable Demo Data", + "uid": "ojonXSp4z", + "version": 45, + "weekStart": "" +} \ No newline at end of file diff --git a/src/img/dashboard.png b/src/img/dashboard.png deleted file mode 100644 index 98e9c41..0000000 Binary files a/src/img/dashboard.png and /dev/null differ diff --git a/src/img/log-view-text.png b/src/img/log-view-text.png new file mode 100644 index 0000000..42ee27c Binary files /dev/null and b/src/img/log-view-text.png differ diff --git a/src/img/log-visualisation.png b/src/img/log-visualisation.png new file mode 100644 index 0000000..b3155b2 Binary files /dev/null and b/src/img/log-visualisation.png differ diff --git a/src/img/logs.png b/src/img/logs.png deleted file mode 100644 index 8488b91..0000000 Binary files a/src/img/logs.png and /dev/null differ diff --git a/src/plugin.json b/src/plugin.json index 182bea9..77ee4f6 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -20,8 +20,8 @@ ], "screenshots": [ {"name": "Query Configuration", "path": "img/configuration.png"}, - {"name": "Log Explorer", "path": "img/logs.png"}, - {"name": "Log Dashboard", "path": "img/dashboard.png"} + {"name": "Log Explorer", "path": "img/log-view-text.png"}, + {"name": "Log Dashboard", "path": "img/log-visualisation.png"} ], "version": "%VERSION%", "updated": "%TODAY%"