From 1212633b210d47e50148c4ebe38ffd6276e2ce0b Mon Sep 17 00:00:00 2001 From: Sriram Date: Tue, 9 Nov 2021 13:04:24 +0000 Subject: [PATCH] formatting fixes --- docker-compose.yml | 2 +- heroku.Dockerfile | 4 +- package.json | 2 +- src/app/parsers/InfinityParser.ts | 68 +++--- src/app/parsers/JSONParser.spec.ts | 2 +- src/app/parsers/XMLParser.spec.ts | 42 ++++ src/app/parsers/XMLParser.ts | 6 +- src/app/parsers/utils.spec.ts | 25 ++ src/app/parsers/utils.ts | 7 +- src/components/DataField.tsx | 2 +- src/components/QueryColumnItem.tsx | 3 + src/components/RootSelector.tsx | 3 +- src/components/URLField.tsx | 3 +- src/editors/query/query.filters.tsx | 2 +- src/editors/query/query.url.options.tsx | 2 +- src/editors/query/query.url.tsx | 2 +- src/plugin.json | 5 +- src/types.ts | 3 +- try/dashboards/aws-status.json | 302 ++++++++++++++++++++++++ try/dashboards/node-graph.json | 145 ++++++++++++ website/src/wiki/installation.md | 8 +- 21 files changed, 581 insertions(+), 57 deletions(-) create mode 100644 src/app/parsers/utils.spec.ts create mode 100644 try/dashboards/aws-status.json create mode 100644 try/dashboards/node-graph.json diff --git a/docker-compose.yml b/docker-compose.yml index 3718ebda..5fb8b789 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.7' services: grafana: - image: grafana/grafana-enterprise:8.2.2 + image: grafana/grafana-enterprise:8.2.3 container_name: yesoreyeram-infinity-datasource ports: - '3000:3000' diff --git a/heroku.Dockerfile b/heroku.Dockerfile index dd63659f..14497b8a 100644 --- a/heroku.Dockerfile +++ b/heroku.Dockerfile @@ -1,6 +1,6 @@ # Inspired by https://github.com/xiz-kak/grafana-on-heroku -FROM grafana/grafana-enterprise:8.2.2 -ENV GF_INSTALL_PLUGINS https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.8.0-dev.5/yesoreyeram-infinity-datasource-0.8.0-dev.5.zip;yesoreyeram-infinity-datasource,grafana-worldmap-panel,grafana-clock-panel,yesoreyeram-boomtheme-panel,yesoreyeram-boomtable-panel,https://github.com/yesoreyeram/yesoreyeram-boomsummary-panel/archive/deecb03210355a7ddd1dfca00474b0bcc28b9b4a.zip;yesoreyeram-boomsummary-panel,https://github.com/yesoreyeram/grafana-boomcomments-panel/archive/2bcba5987e930f18c64e4b648ce49a01639ded8f.zip;yesoreyeram-boomcomments-panel,https://github.com/yesoreyeram/grafana-infinity-panel/archive/90648a35cb87948b27bc6a28f5308b21f1b0880c.zip;yesoreyeram-infinity-panel,https://github.com/yesoreyeram/grafana-slideshow-panel/releases/download/v0.0.1/yesoreyeram-slideshow-panel-0.0.1.zip;yesoreyeram-slideshow-panel,grafana-guidedtour-panel +FROM grafana/grafana-enterprise:8.2.3 +ENV GF_INSTALL_PLUGINS https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.8.0-dev.6/yesoreyeram-infinity-datasource-0.8.0-dev.6.zip;yesoreyeram-infinity-datasource,grafana-worldmap-panel,grafana-clock-panel,yesoreyeram-boomtheme-panel,yesoreyeram-boomtable-panel,https://github.com/yesoreyeram/yesoreyeram-boomsummary-panel/archive/deecb03210355a7ddd1dfca00474b0bcc28b9b4a.zip;yesoreyeram-boomsummary-panel,https://github.com/yesoreyeram/grafana-boomcomments-panel/archive/2bcba5987e930f18c64e4b648ce49a01639ded8f.zip;yesoreyeram-boomcomments-panel,https://github.com/yesoreyeram/grafana-infinity-panel/archive/90648a35cb87948b27bc6a28f5308b21f1b0880c.zip;yesoreyeram-infinity-panel,https://github.com/yesoreyeram/grafana-slideshow-panel/releases/download/v0.0.1/yesoreyeram-slideshow-panel-0.0.1.zip;yesoreyeram-slideshow-panel,grafana-guidedtour-panel ADD ./try/heroku.sh / ADD ./try/grafana.ini /etc/grafana/grafana.ini ADD ./try/dashboards /dashboards/ diff --git a/package.json b/package.json index 6594ba2f..12aa88b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grafana-infinity-datasource", - "version": "0.8.0-dev.6", + "version": "0.8.0-dev.7", "description": "JSON, CSV, XML, GraphQL & HTML datasource for Grafana. Do infinite things with Grafana.", "main": "dist/module.js", "scripts": { diff --git a/src/app/parsers/InfinityParser.ts b/src/app/parsers/InfinityParser.ts index 2b1bf2a2..2e15ecce 100644 --- a/src/app/parsers/InfinityParser.ts +++ b/src/app/parsers/InfinityParser.ts @@ -21,7 +21,7 @@ export class InfinityParser { this.AutoColumns = target.columns || []; this.StringColumns = target.columns.filter((t) => t.type === 'string'); this.NumbersColumns = target.columns.filter((t) => t.type === 'number'); - this.TimeColumns = target.columns.filter((t) => t.type === 'timestamp' || t.type === 'timestamp_epoch' || t.type === 'timestamp_epoch_s'); + this.TimeColumns = target.columns.filter((t) => t.type.startsWith('timestamp')); } } private canAutoGenerateColumns(): boolean { @@ -59,44 +59,42 @@ export class InfinityParser { frame.name = this.target.refId; frame.refId = this.target.refId; return frame; - } else { - if (isDataQuery(this.target) && this.target.format.startsWith('node-graph')) { - const frame = toDataFrame(this.toTable()); - frame.name = this.target.refId; - frame.fields = frame.fields - .map((field) => { - if (field.name.startsWith('arc__')) { - let matching_color_field = frame.fields.find((f) => f.name.startsWith(field.name) && f.name.endsWith('_color')); - if (matching_color_field) { - field.config = { - displayName: field.name.replace('arc__', ''), - color: { - mode: FieldColorMode?.Fixed || 'fixed', - fixedColor: matching_color_field.values.get(0) || '', - }, - }; - } - } else if (field.name.startsWith('detail__')) { + } else if (isDataQuery(this.target) && this.target.format.startsWith('node-graph')) { + const frame = toDataFrame(this.toTable()); + frame.name = this.target.refId; + frame.fields = frame.fields + .map((field) => { + if (field.name.startsWith('arc__')) { + let matching_color_field = frame.fields.find((f) => f.name.startsWith(field.name) && f.name.endsWith('_color')); + if (matching_color_field) { field.config = { - ...field.config, - displayName: field.values.get(0), + displayName: field.name.replace('arc__', ''), + color: { + mode: FieldColorMode?.Fixed || 'fixed', + fixedColor: matching_color_field.values.get(0) || '', + }, }; } - return field; - }) - .filter((f) => { - return !(f.name.startsWith('arc__') && f.name.endsWith('_color')); - }); - if (this.target.format.startsWith('node-')) { - frame.meta = { - ...(frame.meta || {}), - preferredVisualisationType: 'nodeGraph' as PreferredVisualisationType, - }; - } - return frame; - } else { - return this.toTable(); + } else if (field.name.startsWith('detail__')) { + field.config = { + ...field.config, + displayName: field.values.get(0), + }; + } + return field; + }) + .filter((f) => { + return !(f.name.startsWith('arc__') && f.name.endsWith('_color')); + }); + if (this.target.format.startsWith('node-')) { + frame.meta = { + ...(frame.meta || {}), + preferredVisualisationType: 'nodeGraph' as PreferredVisualisationType, + }; } + return frame; + } else { + return this.toTable(); } } } diff --git a/src/app/parsers/JSONParser.spec.ts b/src/app/parsers/JSONParser.spec.ts index c7fe7e8b..cd4e9b4b 100644 --- a/src/app/parsers/JSONParser.spec.ts +++ b/src/app/parsers/JSONParser.spec.ts @@ -99,7 +99,7 @@ describe('JSONParser', () => { expect(JSONResults3.toTable().rows.length).toBe(3); expect(JSONResults3.toTable().rows[0].length).toBe(2); expect(JSONResults3.toTable().rows[1][0]).toBe('bar'); - expect(JSONResults3.toTable().rows[2][1]).toBe(30); + expect(JSONResults3.toTable().rows[2][1]).toBe('30'); expect(JSONResults3.toTable().columns.length).toBe(2); }); }); diff --git a/src/app/parsers/XMLParser.spec.ts b/src/app/parsers/XMLParser.spec.ts index 730379ad..dd4240bf 100644 --- a/src/app/parsers/XMLParser.spec.ts +++ b/src/app/parsers/XMLParser.spec.ts @@ -90,3 +90,45 @@ describe('XMLParser', () => { expect(XMLResults3.toTable().columns.length).toBe(1); }); }); + +const XMLResults4 = new XMLParser( + ` + 2553517.5573549946hello2021-Nov-12 + 2552517.5573549846world2021-Nov-11 + `, + { + refId: '', + type: 'xml', + source: 'inline', + data: '', + format: 'table', + root_selector: 'xml.meters[0].meter', + columns: [ + { + selector: 'e1', + text: 'value', + type: 'number', + }, + { + selector: 'e2', + text: 'foo', + type: 'string', + }, + { + selector: 'e3', + text: 'date', + type: 'timestamp', + }, + ], + } +); +describe('XMLParser', () => { + it('Basic XML', () => { + expect(XMLResults4.toTable().rows.length).toBe(2); + expect(XMLResults4.toTable().rows[0].length).toBe(3); + expect(XMLResults4.toTable().rows[1][0]).toStrictEqual(2552517.5573549846); + expect(XMLResults4.toTable().rows[1][1]).toStrictEqual('world'); + expect(XMLResults4.toTable().rows[1][2]).toStrictEqual(new Date('2021-Nov-11')); + expect(XMLResults4.toTable().columns.length).toBe(3); + }); +}); diff --git a/src/app/parsers/XMLParser.ts b/src/app/parsers/XMLParser.ts index 1657b5cf..398a60e2 100644 --- a/src/app/parsers/XMLParser.ts +++ b/src/app/parsers/XMLParser.ts @@ -31,7 +31,11 @@ export class XMLParser extends InfinityParser { const row: GrafanaTableRow = []; this.target.columns.forEach((c: InfinityColumn) => { let value = get(r, c.selector, ''); - value = getValue(value, c.type); + if (value && Array.isArray(value)) { + value = getValue(value.join(','), c.type); + } else { + value = getValue(value, c.type); + } if (typeof r === 'string') { row.push(r); } else { diff --git a/src/app/parsers/utils.spec.ts b/src/app/parsers/utils.spec.ts new file mode 100644 index 00000000..ba41fa79 --- /dev/null +++ b/src/app/parsers/utils.spec.ts @@ -0,0 +1,25 @@ +import { getValue } from './utils'; + +describe('utils', () => { + it('getValue', () => { + expect(getValue('', 'string')).toStrictEqual(''); + expect(getValue('hello 123', 'string')).toStrictEqual('hello 123'); + expect(getValue(123, 'string')).toStrictEqual('123'); + expect(getValue(0, 'string')).toStrictEqual('0'); + + expect(getValue(123.45, 'number')).toStrictEqual(123.45); + expect(getValue('123', 'number')).toStrictEqual(123); + expect(getValue('123.45', 'number')).toStrictEqual(123.45); + expect(getValue('1,234.5', 'number')).toStrictEqual(1234.5); + expect(getValue('1,234.5abcdef:;!@#$$%^&*()ABCDEF', 'number')).toStrictEqual(1234.5); + expect(getValue(null, 'number')).toStrictEqual(null); + expect(getValue('192.168.0.0', 'number')).toStrictEqual(NaN); + + expect(getValue('2021', 'timestamp')).toStrictEqual(new Date('2021')); + expect(getValue('2021-SEP-20', 'timestamp')).toStrictEqual(new Date('2021-SEP-20')); + expect(getValue('1609459200000', 'timestamp_epoch')).toStrictEqual(new Date('2021')); + expect(getValue(1609459200000, 'timestamp_epoch')).toStrictEqual(new Date('2021')); + expect(getValue('1609459200', 'timestamp_epoch_s')).toStrictEqual(new Date('2021')); + expect(getValue(1609459200, 'timestamp_epoch_s')).toStrictEqual(new Date('2021')); + }); +}); diff --git a/src/app/parsers/utils.ts b/src/app/parsers/utils.ts index 73a73921..c1930a64 100644 --- a/src/app/parsers/utils.ts +++ b/src/app/parsers/utils.ts @@ -52,15 +52,18 @@ export const columnarToTable = (response: any, columns: InfinityColumn[] = []) = return res; }; -export const getValue = (input: string | number | Date, type: InfinityColumnFormat, asTimestamp?: boolean) => { +export const getValue = (input: string | number | Date | null, type: InfinityColumnFormat, asTimestamp?: boolean) => { switch (type) { case 'string': + if (typeof input === 'number') { + return input + ''; + } return input; case 'number': if (typeof input === 'number') { return input; } else if (typeof input === 'string') { - return toNumber((input + '').replace(/,/g, '')); + return toNumber((input + '').replace(/[^0-9.]/g, '')); } else { return null; } diff --git a/src/components/DataField.tsx b/src/components/DataField.tsx index 3c52843e..f9c2eb3e 100644 --- a/src/components/DataField.tsx +++ b/src/components/DataField.tsx @@ -25,7 +25,7 @@ export const DataField = (props: DataFieldProps) => { Data - + ); diff --git a/src/components/QueryColumnItem.tsx b/src/components/QueryColumnItem.tsx index d8694680..05a4fac8 100644 --- a/src/components/QueryColumnItem.tsx +++ b/src/components/QueryColumnItem.tsx @@ -55,6 +55,9 @@ export const QueryColumnItem = (props: QueryColumnItemProps) => { > setText(e.currentTarget.value)} onBlur={onTextChange}> + ); diff --git a/src/components/RootSelector.tsx b/src/components/RootSelector.tsx index 41d8b3c1..872f1628 100644 --- a/src/components/RootSelector.tsx +++ b/src/components/RootSelector.tsx @@ -23,7 +23,8 @@ export const RootSelector = (props: RootSelectorProps) => { setRootSelector(e.currentTarget.value)} diff --git a/src/components/URLField.tsx b/src/components/URLField.tsx index 97a1ae3b..2d018f6e 100644 --- a/src/components/URLField.tsx +++ b/src/components/URLField.tsx @@ -24,9 +24,10 @@ export const URLField = (props: URLFieldProps) => { setURL(e.currentTarget.value)} onBlur={onURLChange} > diff --git a/src/editors/query/query.filters.tsx b/src/editors/query/query.filters.tsx index 4800ea30..1922d7ef 100644 --- a/src/editors/query/query.filters.tsx +++ b/src/editors/query/query.filters.tsx @@ -120,7 +120,7 @@ export const TableFilter = (props: TableFiltersProps) => { )} - + OK diff --git a/src/editors/query/query.url.options.tsx b/src/editors/query/query.url.options.tsx index d82c47d0..76d7c89e 100644 --- a/src/editors/query/query.url.options.tsx +++ b/src/editors/query/query.url.options.tsx @@ -156,7 +156,7 @@ export const URLOptionsEditor = ({ query, onChange, onRunQuery }: URLOptionsProp e.preventDefault(); }} > - HTTP Method, Headers, Query params + HTTP method, Query param, Headers {popupOpenStatus && ( <> diff --git a/src/editors/query/query.url.tsx b/src/editors/query/query.url.tsx index e0ceff06..942d3264 100644 --- a/src/editors/query/query.url.tsx +++ b/src/editors/query/query.url.tsx @@ -22,7 +22,7 @@ export const URLEditor = (props: ScrapperProps) => { {canShowURLField ? (
- {isDataQuery(query) && query.source === 'url' && } +
{isDataQuery(query) && query.source === 'url' && }
) : (
diff --git a/src/plugin.json b/src/plugin.json index 8f49464a..efe452c9 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -3,10 +3,11 @@ "name": "Infinity", "id": "yesoreyeram-infinity-datasource", "type": "datasource", - "backend": true, "executable": "gpx_infinity", + "backend": true, "metrics": true, "annotations": true, + "alerting": false, "info": { "version": "%VERSION%", "updated": "%TODAY%", @@ -19,7 +20,7 @@ "small": "img/icon.svg", "large": "img/icon.svg" }, - "keywords": ["grafana", "json", "csv", "xml", "html", "graphql", "simple-json", "url", "inline", "random walk", "scraping", "node graph"], + "keywords": ["grafana", "json", "csv", "xml", "html", "graphql", "simple-json", "url", "inline", "random walk", "scraping", "node graph", "rest api", "soap"], "screenshots": [ { "name": "features", diff --git a/src/types.ts b/src/types.ts index 33217117..f63c39c4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -230,9 +230,9 @@ export const SCRAP_QUERY_TYPES: Array> = [ { label: 'Global Query', value: 'global' }, ]; export const SCRAP_QUERY_RESULT_FORMATS: Array> = [ + { label: 'Data Frame', value: 'dataframe' }, { label: 'Table', value: 'table' }, { label: 'Time Series', value: 'timeseries' }, - { label: 'Data Frame', value: 'dataframe' }, { label: 'Nodes - Node Graph', value: 'node-graph-nodes' }, { label: 'Edges - Node Graph', value: 'node-graph-edges' }, { label: 'As Is', value: 'as-is' }, @@ -242,7 +242,6 @@ export const SCRAP_QUERY_SOURCES: ScrapQuerySources[] = [ { label: 'Inline', value: 'inline', supported_types: ['csv', 'tsv', 'json', 'xml'] }, { label: 'Random Walk', value: 'random-walk', supported_types: ['series'] }, { label: 'Expression', value: 'expression', supported_types: ['series'] }, - // { label: 'Local File', value: 'local-fs', supported_types: ['csv', 'json', 'xml'] }, ]; export const SCRAP_QUERY_RESULT_COLUMN_FORMATS: Array> = [ { label: 'String', value: 'string' }, diff --git a/try/dashboards/aws-status.json b/try/dashboards/aws-status.json new file mode 100644 index 00000000..39450a10 --- /dev/null +++ b/try/dashboards/aws-status.json @@ -0,0 +1,302 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + }, + { + "datasource": null, + "enable": true, + "iconColor": "red", + "mappings": { + "text": { + "source": "field", + "value": "description" + }, + "time": { + "source": "field", + "value": "pubDate" + }, + "title": { + "source": "field", + "value": "title" + } + }, + "name": "AWS Events", + "target": { + "columns": [ + { + "selector": "title", + "text": "title", + "type": "string" + }, + { + "selector": "pubDate", + "text": "pubDate", + "type": "timestamp" + }, + { + "selector": "description", + "text": "description", + "type": "string" + }, + { + "selector": "guid[0]._", + "text": "link", + "type": "string" + } + ], + "csv_options": { + "columns": "", + "comment": "", + "delimiter": ",", + "relax_column_count": false, + "skip_empty_lines": false, + "skip_lines_with_error": false + }, + "data": "", + "filters": [], + "format": "dataframe", + "global_query_id": "", + "refId": "Anno", + "root_selector": "rss.channel[0].item", + "source": "url", + "type": "xml", + "url": "https://status.aws.amazon.com/rss/all.rss", + "url_options": { + "data": "", + "method": "GET" + } + } + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": null, + "graphTooltip": 0, + "id": 5, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single" + } + }, + "targets": [ + { + "alias": "Random Walk", + "columns": [], + "csv_options": { + "columns": "", + "comment": "", + "delimiter": ",", + "relax_column_count": false, + "skip_empty_lines": false, + "skip_lines_with_error": false + }, + "data": "", + "dataOverrides": [], + "filters": [], + "format": "table", + "global_query_id": "", + "refId": "A", + "root_selector": "", + "source": "random-walk", + "type": "series", + "url": "https://jsonplaceholder.typicode.com/users", + "url_options": { + "data": "", + "method": "GET" + } + } + ], + "title": "Panel Title", + "type": "timeseries" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 3, + "options": { + "showHeader": true + }, + "pluginVersion": "8.2.2", + "targets": [ + { + "alias": "Random Walk", + "columns": [ + { + "selector": "pubDate", + "text": "pubDate", + "type": "timestamp" + }, + { + "selector": "title", + "text": "title", + "type": "string" + }, + { + "selector": "description", + "text": "description", + "type": "string" + }, + { + "selector": "guid[0]._", + "text": "Link", + "type": "string" + } + ], + "csv_options": { + "columns": "", + "comment": "", + "delimiter": ",", + "relax_column_count": false, + "skip_empty_lines": false, + "skip_lines_with_error": false + }, + "data": "", + "dataOverrides": [], + "filters": [], + "format": "table", + "global_query_id": "", + "refId": "A", + "root_selector": "rss.channel[0].item", + "source": "url", + "type": "xml", + "url": "https://status.aws.amazon.com/rss/all.rss", + "url_options": { + "data": "", + "method": "GET" + } + } + ], + "title": "AWS Status", + "type": "table" + } + ], + "refresh": false, + "schemaVersion": 31, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-30d", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "AWS Status Feed", + "uid": "aws-status", + "version": 3 +} diff --git a/try/dashboards/node-graph.json b/try/dashboards/node-graph.json new file mode 100644 index 00000000..d88bcf44 --- /dev/null +++ b/try/dashboards/node-graph.json @@ -0,0 +1,145 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- 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, + "gnetId": null, + "graphTooltip": 0, + "id": 6, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": "Infinity", + "gridPos": { + "h": 19, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "pluginVersion": "8.2.0", + "targets": [ + { + "columns": [ + { + "selector": "id", + "text": "", + "type": "string" + }, + { + "selector": "title", + "text": "", + "type": "string" + }, + { + "selector": "sub-title", + "text": "subTitle", + "type": "string" + }, + { + "selector": "cpu", + "text": "mainStat", + "type": "number" + }, + { + "selector": "memory", + "text": "secondaryStat", + "type": "number" + }, + { + "selector": "c_disk_size", + "text": "arc__cpu", + "type": "number" + }, + { + "selector": "d", + "text": "arc__memory", + "type": "number" + }, + { + "selector": "c_disk_size color", + "text": "arc__cpu_color", + "type": "string" + }, + { + "selector": "d color", + "text": "arc__memory_color", + "type": "string" + }, + { + "selector": "detail__hello", + "text": "", + "type": "string" + } + ], + "data": "id,title,sub-title,cpu,memory,c_disk_size,d,c_disk_size color,d color,detail__hello\nA,Server A,Application Server,12,10,0.1,0.9,blue,red,world\nB,Server B,DB Server,90,87,0.1,0.9,blue,red,hello\nC,Server C,Application Server,20,23,0.20,0.80,blue,red,hello\nD,Server D,Middleware Server,47,98,0.90,0.10,blue,red,world", + "filters": [], + "format": "node-graph-nodes", + "global_query_id": "", + "refId": "A", + "root_selector": "", + "source": "inline", + "type": "csv", + "url": "", + "url_options": { + "data": "", + "method": "GET" + } + }, + { + "columns": [], + "data": "id,source,target,mainStat,secondaryStat,detail__one\n1,A,B,30,mb/s,abc\n2,A,C,20,mb/s,def\n3,B,D,24.2,mb/s,ghi", + "filters": [], + "format": "node-graph-edges", + "global_query_id": "", + "hide": false, + "refId": "B", + "root_selector": "", + "source": "inline", + "type": "csv", + "url": "", + "url_options": { + "data": "", + "method": "GET" + } + } + ], + "title": "Sample node graph", + "type": "nodeGraph" + } + ], + "refresh": "", + "schemaVersion": 31, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Node Graph", + "uid": "node-graph", + "version": 7 +} diff --git a/website/src/wiki/installation.md b/website/src/wiki/installation.md index f3ff02f0..f0aed123 100644 --- a/website/src/wiki/installation.md +++ b/website/src/wiki/installation.md @@ -34,7 +34,7 @@ grafana-cli --pluginUrl plugins install yesoreyeram-infinity-data Example: ```shell -grafana-cli --pluginUrl https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.8.0-dev.4/yesoreyeram-infinity-datasource-0.8.0-dev.5.zip plugins install yesoreyeram-infinity-datasource +grafana-cli --pluginUrl https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.8.0-dev.6/yesoreyeram-infinity-datasource-0.8.0-dev.6.zip plugins install yesoreyeram-infinity-datasource ``` ### Install using helm chart @@ -57,7 +57,7 @@ Example: ```yml plugins: - - https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.8.0-dev.5/yesoreyeram-infinity-datasource-0.8.0-dev.5.zip;yesoreyeram-infinity-datasource + - https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.8.0-dev.6/yesoreyeram-infinity-datasource-0.8.0-dev.6.zip;yesoreyeram-infinity-datasource ``` ### Install using docker @@ -65,11 +65,11 @@ plugins: With docker, you can install the plugin using the following command. This will download the latest published version of the plugin from grafana plugins directory. ```shell -docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=yesoreyeram-infinity-datasource" grafana/grafana:8.2.2 +docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=yesoreyeram-infinity-datasource" grafana/grafana-enterprise:8.2.3 ``` If you need to install a custom version of the plugin with docker, use the following command. ```shell -docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.8.0-dev.5/yesoreyeram-infinity-datasource-0.8.0-dev.5.zip;yesoreyeram-infinity-datasource" grafana/grafana:8.2.2 +docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.8.0-dev.6/yesoreyeram-infinity-datasource-0.8.0-dev.6.zip;yesoreyeram-infinity-datasource" grafana/grafana-enterprise:8.2.3 ```