From 1f36fef4fb70d29a37954f7db5ede4655d564d0b Mon Sep 17 00:00:00 2001 From: Andy Lake Date: Wed, 26 Jun 2024 15:04:14 -0400 Subject: [PATCH] Updating grafana template to account for bucket width --- .../templates/endpoints.json.j2 | 351 ++++++++++++++++-- 1 file changed, 322 insertions(+), 29 deletions(-) diff --git a/psconfig/perfsonar-psconfig/templates/endpoints.json.j2 b/psconfig/perfsonar-psconfig/templates/endpoints.json.j2 index bc71142..757467b 100644 --- a/psconfig/perfsonar-psconfig/templates/endpoints.json.j2 +++ b/psconfig/perfsonar-psconfig/templates/endpoints.json.j2 @@ -18,6 +18,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, + "id": 7, "links": [], "liveNow": false, "panels": [ @@ -25,10 +26,10 @@ "datasource": {{ grafana_datasource|tojson }}, "type": "text", "gridPos": { - "x": 0, - "y": 0, + "h": 3, "w": 24, - "h": 3 + "x": 0, + "y": 0 }, "id": 1000, "options": { @@ -40,8 +41,8 @@ }, "content": "
\n\n \n\nDashboards\n
\n\n\n" }, - "pluginVersion": "10.2.0", - "transparent": true + "pluginVersion": "10.4.3", + "transparent": true, }, { "datasource": {{ grafana_datasource|tojson }}, @@ -682,8 +683,36 @@ "metrics": [ { "field": "result.latency.p_95", + "hide": true, "id": "1", "type": "max" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "hide": false, + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * (params.bucket_width / 0.001)" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$source OR reference.display-set-source.keyword:$source_ref) AND (test.spec.dest.keyword:$dest OR reference.display-set-dest.keyword:$dest_ref)", @@ -764,8 +793,35 @@ "metrics": [ { "field": "result.latency.median", + "hide": true, "id": "1", "type": "max" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * (params.bucket_width / 0.001)" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$source OR reference.display-set-source.keyword:$source_ref) AND (test.spec.dest.keyword:$dest OR reference.display-set-dest.keyword:$dest_ref)", @@ -846,8 +902,35 @@ "metrics": [ { "field": "result.latency.min", + "hide": true, "id": "1", "type": "min" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * (params.bucket_width / 0.001)" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$source OR reference.display-set-source.keyword:$source_ref) AND (test.spec.dest.keyword:$dest OR reference.display-set-dest.keyword:$dest_ref)", @@ -1009,8 +1092,35 @@ "metrics": [ { "field": "result.latency.p_95", + "hide": true, "id": "1", "type": "max" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * (params.bucket_width / 0.001)" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$dest OR reference.display-set-source.keyword:$dest_ref) AND (test.spec.dest.keyword:$source OR reference.display-set-dest.keyword:$source_ref)", @@ -1091,8 +1201,35 @@ "metrics": [ { "field": "result.latency.median", + "hide": true, "id": "1", "type": "max" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * (params.bucket_width / 0.001)" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$dest OR reference.display-set-source.keyword:$dest_ref) AND (test.spec.dest.keyword:$source OR reference.display-set-dest.keyword:$source_ref)", @@ -1173,8 +1310,35 @@ "metrics": [ { "field": "result.latency.min", + "hide": true, "id": "1", "type": "min" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * (params.bucket_width / 0.001)" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$dest OR reference.display-set-source.keyword:$dest_ref) AND (test.spec.dest.keyword:$source OR reference.display-set-dest.keyword:$source_ref)", @@ -1664,8 +1828,35 @@ "metrics": [ { "field": "result.latency.stddev", + "hide": true, "id": "1", "type": "avg" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * (params.bucket_width / 0.001)" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$source OR reference.display-set-source.keyword:$source_ref) AND (test.spec.dest.keyword:$dest OR reference.display-set-dest.keyword:$dest_ref)", @@ -1746,8 +1937,35 @@ "metrics": [ { "field": "result.latency.variance", + "hide": true, "id": "1", "type": "avg" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * ((params.bucket_width * params.bucket_width) / (0.001 * 0.001))" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$source OR reference.display-set-source.keyword:$source_ref) AND (test.spec.dest.keyword:$dest OR reference.display-set-dest.keyword:$dest_ref)", @@ -1839,7 +2057,15 @@ "type": "avg" }, { + "field": "test.spec.bucket-width", "id": "9", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "10", "pipelineVariables": [ { "name": "var1", @@ -1848,10 +2074,14 @@ { "name": "var2", "pipelineAgg": "8" + }, + { + "name": "bucket_width", + "pipelineAgg": "9" } ], "settings": { - "script": "params.var1 - params.var2" + "script": "(params.var1 - params.var2) * (params.bucket_width / 0.001)" }, "type": "bucket_script" } @@ -2015,8 +2245,35 @@ "metrics": [ { "field": "result.latency.stddev", + "hide": true, "id": "1", "type": "avg" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * (params.bucket_width / 0.001)" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$dest OR reference.display-set-source.keyword:$dest_ref) AND (test.spec.dest.keyword:$source OR reference.display-set-dest.keyword:$source_ref)", @@ -2097,8 +2354,35 @@ "metrics": [ { "field": "result.latency.variance", + "hide": true, "id": "1", "type": "avg" + }, + { + "field": "test.spec.bucket-width", + "hide": true, + "id": "8", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "9", + "pipelineVariables": [ + { + "name": "latency", + "pipelineAgg": "1" + }, + { + "name": "bucket_width", + "pipelineAgg": "8" + } + ], + "settings": { + "script": "params.latency * ((params.bucket_width * params.bucket_width) / (0.001 * 0.001))" + }, + "type": "bucket_script" } ], "query": "test.type.keyword:latencybg AND (test.spec.source.keyword:$dest OR reference.display-set-source.keyword:$dest_ref) AND (test.spec.dest.keyword:$source OR reference.display-set-dest.keyword:$source_ref)", @@ -2190,7 +2474,16 @@ "type": "avg" }, { + "field": "test.spec.bucket-width", + "hide": true, "id": "9", + "settings": { + "missing": "0.001" + }, + "type": "max" + }, + { + "id": "10", "pipelineVariables": [ { "name": "var1", @@ -2199,10 +2492,14 @@ { "name": "var2", "pipelineAgg": "8" + }, + { + "name": "bucket_width", + "pipelineAgg": "9" } ], "settings": { - "script": "params.var1 - params.var2" + "script": "(params.var1 - params.var2) * (params.bucket_width / 0.001)" }, "type": "bucket_script" } @@ -2552,7 +2849,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "10.2.0", + "pluginVersion": "10.4.3", "targets": [ { "alias": "", @@ -2628,11 +2925,11 @@ "indexByName": {}, "renameByName": { "Max": "", - "test.spec.dest.keyword": "Destination", "meta.ip_version": "", - "test.spec.source.keyword": "Source", "pscheduler.tool.keyword": "Tool", - "result.hop.ip_str.keyword": "Hops" + "result.hop.ip_str.keyword": "Hops", + "test.spec.dest.keyword": "Destination", + "test.spec.source.keyword": "Source" } } } @@ -2731,7 +3028,7 @@ "showHeader": true, "sortBy": [] }, - "pluginVersion": "10.2.0", + "pluginVersion": "10.4.3", "targets": [ { "alias": "", @@ -2807,11 +3104,11 @@ "indexByName": {}, "renameByName": { "Max": "", - "test.spec.dest.keyword": "Destination", "meta.ip_version": "", - "test.spec.source.keyword": "Source", "pscheduler.tool.keyword": "Tool", - "result.hop.ip_str.keyword": "Hops" + "result.hop.ip_str.keyword": "Hops", + "test.spec.dest.keyword": "Destination", + "test.spec.source.keyword": "Source" } } } @@ -2848,8 +3145,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2969,14 +3265,12 @@ "host": 10, "id": 11, "meta.destination.geo.as": 12, - "test.spec.dest": 4, "meta.destination.ip": 5, "meta.ip_version": 13, "meta.observer.geo.as": 14, "meta.observer.hostname": 15, "meta.observer.ip": 16, "meta.source.geo.as": 17, - "test.spec.source": 2, "meta.source.ip": 3, "pscheduler.added": 18, "pscheduler.duration": 19, @@ -3054,11 +3348,11 @@ }, "renameByName": { "Max": "", - "test.spec.dest.keyword": "Destination", "meta.ip_version": "", - "test.spec.source.keyword": "Source", "pscheduler.tool.keyword": "Tool", - "result.hop.ip_str.keyword": "Hops" + "result.hop.ip_str.keyword": "Hops", + "test.spec.dest.keyword": "Destination", + "test.spec.source.keyword": "Source" } } } @@ -3085,8 +3379,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3199,11 +3492,11 @@ "indexByName": {}, "renameByName": { "Max": "", - "test.spec.dest.keyword": "Destination", "meta.ip_version": "", - "test.spec.source.keyword": "Source", "pscheduler.tool.keyword": "Tool", - "result.hop.ip_str.keyword": "Hops" + "result.hop.ip_str.keyword": "Hops", + "test.spec.dest.keyword": "Destination", + "test.spec.source.keyword": "Source" } } } @@ -3233,7 +3526,7 @@ "content": "
\n
Privacy Policy | Global Node Directory | Host JSON
\n
 Powered by Grafana
", "mode": "html" }, - "pluginVersion": "10.2.0", + "pluginVersion": "10.4.3", "targets": [ { "alias": "", @@ -3266,7 +3559,7 @@ } ], "refresh": "", - "schemaVersion": 38, + "schemaVersion": 39, "tags": [], "templating": { "list": [