Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

Commit

Permalink
feat(grafana): use nodename in cluster history dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Dec 1, 2019
1 parent ff383d5 commit bf9b41f
Showing 1 changed file with 236 additions and 12 deletions.
248 changes: 236 additions & 12 deletions grafana/cluster/instance-history.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"fill": 0,
"fillGradient": 2,
"gridPos": {
"h": 10,
"w": 24,
"h": 12,
"w": 12,
"x": 0,
"y": 0
},
Expand Down Expand Up @@ -63,7 +63,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n l.labels->>'instance' AS metric,\n s.time,\n s.value\nFROM ((\n SELECT\n lid,\n bucket AS time,\n max_load AS value\n FROM\n agg_instance_load_long\n WHERE \n $__timeFilter(bucket) AND\n bucket < NOW() - INTERVAL '1 day'\n ORDER BY lid, bucket\n) UNION ALL (\n SELECT\n lid,\n bucket AS time,\n max_load AS value\n FROM\n agg_instance_load\n WHERE \n $__timeFilter(bucket) AND\n bucket > NOW() - INTERVAL '1 day'\n ORDER BY lid, bucket\n) UNION ALL (\n SELECT\n lid,\n \"tg\" AS \"time\",\n MAX(\"value\") AS \"value\"\n FROM (\n SELECT\n lid,\n time_bucket(INTERVAL '1 minute', time) AS \"tg\",\n value\n FROM metrics\n WHERE\n $__timeFilter(time) AND\n time > NOW() - INTERVAL '15 minutes' AND\n name = 'node_load1' AND\n value != 'NaN'\n ) t\n GROUP BY lid, time\n ORDER BY lid, time\n)) AS s\nJOIN metric_labels AS l\nON l.lid = s.lid\nORDER BY s.time, s.lid;",
"rawSql": "SELECT\n ll.labels->>'nodename' AS metric,\n s.time,\n s.value\nFROM ((\n SELECT\n lid,\n bucket AS time,\n max_load AS value\n FROM\n agg_instance_load_long\n WHERE \n $__timeFilter(bucket) AND\n bucket < NOW() - INTERVAL '1 day'\n ORDER BY lid, bucket\n) UNION ALL (\n SELECT\n lid,\n bucket AS time,\n max_load AS value\n FROM\n agg_instance_load\n WHERE \n $__timeFilter(bucket) AND\n bucket > NOW() - INTERVAL '1 day'\n ORDER BY lid, bucket\n) UNION ALL (\n SELECT\n lid,\n \"tg\" AS \"time\",\n MAX(\"value\") AS \"value\"\n FROM (\n SELECT\n lid,\n time_bucket(INTERVAL '1 minute', time) AS \"tg\",\n value\n FROM metrics\n WHERE\n $__timeFilter(time) AND\n time > NOW() - INTERVAL '15 minutes' AND\n name = 'node_load1' AND\n value != 'NaN'\n ) t\n GROUP BY lid, time\n ORDER BY lid, time\n)) AS s\nJOIN metric_labels AS l\nON l.lid = s.lid\nJOIN metric_labels AS ll \nON ll.labels->>'__name__' = 'node_uname_info' AND l.labels->>'instance' = ll.labels->>'instance'\nORDER BY s.time, s.lid;",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -137,10 +137,10 @@
"fill": 1,
"fillGradient": 1,
"gridPos": {
"h": 10,
"w": 24,
"x": 0,
"y": 10
"h": 12,
"w": 12,
"x": 12,
"y": 0
},
"id": 3,
"legend": {
Expand Down Expand Up @@ -168,14 +168,14 @@
"seriesOverrides": [],
"spaceLength": 10,
"stack": true,
"steppedLine": true,
"steppedLine": false,
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n a.bucket AS time,\n a.pods,\n REGEXP_REPLACE(l.labels->>'instance', '(.+):[0-9]+', '\\1') AS instance\nFROM\n agg_instance_pods AS a\nJOIN\n metric_labels AS l\nON l.lid = a.lid;",
"rawSql": "SELECT\n s.bucket AS time,\n s.pods AS value,\n ll.labels->>'nodename' AS metric\nFROM\n agg_instance_pods AS s\nJOIN metric_labels AS l\nON l.lid = s.lid\nJOIN metric_labels AS ll \nON ll.labels->>'__name__' = 'node_uname_info' AND REGEXP_REPLACE(l.labels->>'instance', ':.*', '') = REGEXP_REPLACE(ll.labels->>'instance', ':.*', '')\nORDER BY bucket, metric",
"refId": "A",
"select": [
[
Expand Down Expand Up @@ -239,17 +239,241 @@
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "monitor-timescale",
"fill": 0,
"fillGradient": 1,
"gridPos": {
"h": 12,
"w": 12,
"x": 0,
"y": 12
},
"id": 5,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"show": true,
"sort": "max",
"sortDesc": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n a.bucket AS time,\n MAX(a.delta_usage) AS value,\n CONCAT(l.labels->>'namespace', '/', l.labels->>'pod') AS metric\nFROM\n agg_container_cpu AS a\nJOIN\n metric_labels AS l\nON l.lid = a.lid\nWHERE $__timeFilter(bucket) AND l.labels ? 'pod' AND l.labels->>'namespace' != 'gitlab-jobs'\nGROUP BY bucket, metric\nORDER BY bucket, metric;",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"table": "metrics",
"timeColumn": "\"time\"",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Container CPU",
"tooltip": {
"shared": false,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "percentunit",
"label": null,
"logBase": 1,
"max": "1",
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "monitor-timescale",
"fill": 0,
"fillGradient": 1,
"gridPos": {
"h": 12,
"w": 12,
"x": 12,
"y": 12
},
"id": 6,
"legend": {
"alignAsTable": true,
"avg": false,
"current": true,
"max": true,
"min": false,
"show": true,
"sort": "max",
"sortDesc": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n a.bucket AS time,\n MAX(a.max_rss) AS value,\n CONCAT(l.labels->>'namespace', '/', l.labels->>'pod') AS metric\nFROM\n agg_container_mem AS a\nJOIN\n metric_labels AS l\nON l.lid = a.lid\nWHERE\n $__timeFilter(bucket) AND\n l.labels ? 'pod' AND\n l.labels->>'namespace' != 'gitlab-jobs'\nGROUP BY bucket, metric\nORDER BY bucket, metric;",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"table": "metrics",
"timeColumn": "\"time\"",
"timeColumnType": "timestamp",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Container RSS",
"tooltip": {
"shared": false,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": false,
"refresh": "",
"schemaVersion": 20,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"from": "now-7d",
"to": "now"
},
"timepicker": {
Expand All @@ -269,5 +493,5 @@
"timezone": "",
"title": "Instance History",
"uid": "InV0jobZz",
"version": 10
"version": 21
}

0 comments on commit bf9b41f

Please sign in to comment.