Added new config to the config generator. Import Grafana dashboards

This commit is contained in:
CarlosEDP 2019-02-04 18:02:26 -02:00
parent 06671c0121
commit 158acde3ac
7 changed files with 3320 additions and 4460 deletions

6
generate_ingress_auth.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo "Run the script with the required auth user and namespace for the secret: ${0} [user] [namespace]"
exit 0
fi
printf "${1}:`openssl passwd -apr1`\n" >> auth

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,53 +1,4 @@
{ {
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
},
{
"name": "VAR_SCRAPE_INTERVAL",
"type": "constant",
"label": "Scrape interval seconds",
"value": "60",
"description": ""
}
],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "5.0.0"
},
{
"type": "panel",
"id": "graph",
"name": "Graph",
"version": "5.0.0"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "5.0.0"
},
{
"type": "panel",
"id": "singlestat",
"name": "Singlestat",
"version": "5.0.0"
},
{
"type": "panel",
"id": "text",
"name": "Text",
"version": "5.0.0"
}
],
"annotations": { "annotations": {
"list": [ "list": [
{ {
@ -95,8 +46,8 @@
"editable": true, "editable": true,
"gnetId": 3681, "gnetId": 3681,
"graphTooltip": 1, "graphTooltip": 1,
"id": null, "id": 13,
"iteration": 1520350506982, "iteration": 1549118131383,
"links": [ "links": [
{ {
"icon": "info", "icon": "info",
@ -141,7 +92,7 @@
"rgba(237, 129, 40, 0.89)", "rgba(237, 129, 40, 0.89)",
"#bf1b00" "#bf1b00"
], ],
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"decimals": 1, "decimals": 1,
"format": "s", "format": "s",
"gauge": { "gauge": {
@ -223,7 +174,7 @@
"rgba(237, 129, 40, 0.89)", "rgba(237, 129, 40, 0.89)",
"#bf1b00" "#bf1b00"
], ],
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"format": "short", "format": "short",
"gauge": { "gauge": {
"maxValue": 1000000, "maxValue": 1000000,
@ -304,7 +255,7 @@
"rgba(237, 129, 40, 0.89)", "rgba(237, 129, 40, 0.89)",
"#d44a3a" "#d44a3a"
], ],
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"format": "none", "format": "none",
"gauge": { "gauge": {
"maxValue": 100, "maxValue": 100,
@ -385,7 +336,7 @@
"rgba(237, 129, 40, 0.89)", "rgba(237, 129, 40, 0.89)",
"#d44a3a" "#d44a3a"
], ],
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"decimals": 2, "decimals": 2,
"format": "ms", "format": "ms",
"gauge": { "gauge": {
@ -483,7 +434,7 @@
"rgba(237, 129, 40, 0.89)", "rgba(237, 129, 40, 0.89)",
"#299c46" "#299c46"
], ],
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"decimals": 1, "decimals": 1,
"format": "none", "format": "none",
"gauge": { "gauge": {
@ -620,6 +571,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Query elapsed time", "title": "Query elapsed time",
"tooltip": { "tooltip": {
@ -653,7 +605,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -717,6 +673,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Head series created/deleted", "title": "Head series created/deleted",
"tooltip": { "tooltip": {
@ -750,7 +707,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -898,6 +859,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Prometheus errors", "title": "Prometheus errors",
"tooltip": { "tooltip": {
@ -931,7 +893,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -1003,6 +969,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Scrape delay (counts with 1m scrape interval)", "title": "Scrape delay (counts with 1m scrape interval)",
"tooltip": { "tooltip": {
@ -1034,7 +1001,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -1096,6 +1067,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Rule evaulation duration", "title": "Rule evaulation duration",
"tooltip": { "tooltip": {
@ -1129,7 +1101,11 @@
"min": "0", "min": "0",
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -1200,6 +1176,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Request count", "title": "Request count",
"tooltip": { "tooltip": {
@ -1233,7 +1210,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -1291,6 +1272,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Request duration per handler", "title": "Request duration per handler",
"tooltip": { "tooltip": {
@ -1324,7 +1306,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -1380,6 +1366,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Request size by handler", "title": "Request size by handler",
"tooltip": { "tooltip": {
@ -1413,7 +1400,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -1489,6 +1480,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Cont of concurent queries", "title": "Cont of concurent queries",
"tooltip": { "tooltip": {
@ -1522,7 +1514,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -1610,6 +1606,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Alert queue size", "title": "Alert queue size",
"tooltip": { "tooltip": {
@ -1643,7 +1640,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -1700,6 +1701,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Count of discovered alertmanagers", "title": "Count of discovered alertmanagers",
"tooltip": { "tooltip": {
@ -1733,7 +1735,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -1801,6 +1807,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Alerting errors", "title": "Alerting errors",
"tooltip": { "tooltip": {
@ -1834,7 +1841,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -1855,7 +1866,7 @@
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -1897,6 +1908,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Consul SD sync count", "title": "Consul SD sync count",
"tooltip": { "tooltip": {
@ -1929,14 +1941,18 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -1978,6 +1994,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Marathon SD sync count", "title": "Marathon SD sync count",
"tooltip": { "tooltip": {
@ -2010,14 +2027,18 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -2059,6 +2080,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Kubernetes SD sync count", "title": "Kubernetes SD sync count",
"tooltip": { "tooltip": {
@ -2091,7 +2113,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -2189,6 +2215,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Service discovery errors", "title": "Service discovery errors",
"tooltip": { "tooltip": {
@ -2222,7 +2249,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -2243,7 +2274,7 @@
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -2284,6 +2315,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Reloaded block from disk", "title": "Reloaded block from disk",
"tooltip": { "tooltip": {
@ -2316,7 +2348,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -2373,6 +2409,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Loaded data blocks", "title": "Loaded data blocks",
"tooltip": { "tooltip": {
@ -2406,7 +2443,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -2463,6 +2504,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Time series total count", "title": "Time series total count",
"tooltip": { "tooltip": {
@ -2496,7 +2538,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": {}, "aliasColors": {},
@ -2548,6 +2594,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Samples Appended per second", "title": "Samples Appended per second",
"tooltip": { "tooltip": {
@ -2581,7 +2628,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -2659,6 +2710,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Head chunks count", "title": "Head chunks count",
"tooltip": { "tooltip": {
@ -2692,14 +2744,18 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -2740,6 +2796,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Length of head block", "title": "Length of head block",
"tooltip": { "tooltip": {
@ -2772,7 +2829,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -2834,6 +2895,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Head Chunks Created/Deleted per second", "title": "Head Chunks Created/Deleted per second",
"tooltip": { "tooltip": {
@ -2867,7 +2929,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -2888,7 +2954,7 @@
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -2929,6 +2995,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Compaction duration", "title": "Compaction duration",
"tooltip": { "tooltip": {
@ -2961,14 +3028,18 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -3009,6 +3080,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Go Garbage collection duration", "title": "Go Garbage collection duration",
"tooltip": { "tooltip": {
@ -3041,14 +3113,18 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -3089,6 +3165,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "WAL truncate duration seconds", "title": "WAL truncate duration seconds",
"tooltip": { "tooltip": {
@ -3121,14 +3198,18 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
"dashLength": 10, "dashLength": 10,
"dashes": false, "dashes": false,
"datasource": "${DS_PROMETHEUS}", "datasource": "prometheus",
"fill": 1, "fill": 1,
"gridPos": { "gridPos": {
"h": 7, "h": 7,
@ -3169,6 +3250,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "WAL fsync duration seconds", "title": "WAL fsync duration seconds",
"tooltip": { "tooltip": {
@ -3201,7 +3283,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -3307,6 +3393,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Memory", "title": "Memory",
"tooltip": { "tooltip": {
@ -3340,7 +3427,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": { "aliasColors": {
@ -3399,6 +3490,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Allocations per second", "title": "Allocations per second",
"tooltip": { "tooltip": {
@ -3432,7 +3524,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"aliasColors": {}, "aliasColors": {},
@ -3488,6 +3584,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "CPU per second", "title": "CPU per second",
"tooltip": { "tooltip": {
@ -3523,7 +3620,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
}, },
{ {
"collapsed": false, "collapsed": false,
@ -4895,6 +4996,7 @@
], ],
"thresholds": [], "thresholds": [],
"timeFrom": null, "timeFrom": null,
"timeRegions": [],
"timeShift": null, "timeShift": null,
"title": "Net errors", "title": "Net errors",
"tooltip": { "tooltip": {
@ -4928,7 +5030,11 @@
"min": null, "min": null,
"show": true "show": true
} }
] ],
"yaxis": {
"align": false,
"alignLevel": null
}
} }
], ],
"refresh": "5m", "refresh": "5m",
@ -5009,12 +5115,17 @@
], ],
"query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d", "query": "1m,10m,30m,1h,6h,12h,1d,7d,14d,30d",
"refresh": 2, "refresh": 2,
"skipUrlSync": false,
"type": "interval" "type": "interval"
}, },
{ {
"allValue": null, "allValue": null,
"current": {}, "current": {
"text": "10.32.0.53:9090",
"value": "10.32.0.53:9090"
},
"datasource": "$datasource", "datasource": "$datasource",
"definition": "",
"hide": 0, "hide": 0,
"includeAll": false, "includeAll": false,
"label": "Instance", "label": "Instance",
@ -5024,6 +5135,7 @@
"query": "label_values(prometheus_build_info, instance)", "query": "label_values(prometheus_build_info, instance)",
"refresh": 2, "refresh": 2,
"regex": "", "regex": "",
"skipUrlSync": false,
"sort": 2, "sort": 2,
"tagValuesQuery": "", "tagValuesQuery": "",
"tags": [], "tags": [],
@ -5033,19 +5145,20 @@
}, },
{ {
"current": { "current": {
"value": "${VAR_SCRAPE_INTERVAL}", "text": "60",
"text": "${VAR_SCRAPE_INTERVAL}" "value": "60"
}, },
"hide": 0, "hide": 0,
"label": "Scrape interval seconds", "label": "Scrape interval seconds",
"name": "scrape_interval", "name": "scrape_interval",
"options": [ "options": [
{ {
"value": "${VAR_SCRAPE_INTERVAL}", "text": "60",
"text": "${VAR_SCRAPE_INTERVAL}" "value": "60"
} }
], ],
"query": "${VAR_SCRAPE_INTERVAL}", "query": "60",
"skipUrlSync": false,
"type": "constant" "type": "constant"
}, },
{ {
@ -5060,6 +5173,7 @@
"query": "prometheus", "query": "prometheus",
"refresh": 1, "refresh": 1,
"regex": "", "regex": "",
"skipUrlSync": false,
"type": "datasource" "type": "datasource"
}, },
{ {
@ -5074,12 +5188,13 @@
"query": "influxdb", "query": "influxdb",
"refresh": 1, "refresh": 1,
"regex": "", "regex": "",
"skipUrlSync": false,
"type": "datasource" "type": "datasource"
} }
] ]
}, },
"time": { "time": {
"from": "now-7d", "from": "now-3h",
"to": "now" "to": "now"
}, },
"timepicker": { "timepicker": {
@ -5110,5 +5225,5 @@
"timezone": "browser", "timezone": "browser",
"title": "Prometheus2.0", "title": "Prometheus2.0",
"uid": "XmsJC9mRz", "uid": "XmsJC9mRz",
"version": 4 "version": 1
} }

View File

@ -1,6 +1,11 @@
local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + { local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') +
// (import 'kube-prometheus/kube-prometheus-anti-affinity.libsonnet') +
(import 'kube-prometheus/kube-prometheus-kops-coredns.libsonnet') +
(import 'kube-prometheus/kube-prometheus-kubeadm.libsonnet') +
(import 'image_sources_versions.jsonnet') +
{
_config+:: { _config+:: {
namespace: "monitoring", namespace: "monitoring",
@ -12,67 +17,17 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
prom_ingress: 'prometheus.internal.carlosedp.com', prom_ingress: 'prometheus.internal.carlosedp.com',
alert_ingress: 'alertmanager.internal.carlosedp.com', alert_ingress: 'alertmanager.internal.carlosedp.com',
grafana_ingress: 'grafana.internal.carlosedp.com', grafana_ingress: 'grafana.internal.carlosedp.com',
}, grafana_ingress_external: 'grafana.cloud.carlosedp.com',
versions+:: {
prometheus: "v2.5.0",
alertmanager: "v0.15.3",
kubeStateMetrics: "v1.5.0",
kubeRbacProxy: "v0.4.1",
addonResizer: "2.1",
nodeExporter: "v0.17.0",
prometheusOperator: "v0.28.0",
prometheusAdapter: "v0.4.1",
grafana: "v5.4.0",
configmapReloader: "v0.2.2",
prometheusConfigReloader: "v0.28.0",
},
imageRepos+:: {
prometheus: "carlosedp/prometheus",
alertmanager: "carlosedp/alertmanager",
kubeStateMetrics: "carlosedp/kube-state-metrics",
kubeRbacProxy: "carlosedp/kube-rbac-proxy",
addonResizer: "carlosedp/addon-resizer",
nodeExporter: "carlosedp/node_exporter",
prometheusOperator: "carlosedp/prometheus-operator",
prometheusAdapter: "carlosedp/k8s-prometheus-adapter",
grafana: "carlosedp/monitoring-grafana",
configmapReloader: "carlosedp/configmap-reload",
prometheusConfigReloader: "carlosedp/prometheus-config-reloader",
}, },
prometheus+:: { prometheus+:: {
names: 'k8s', names: 'k8s',
replicas: 1, replicas: 1,
namespaces: ["default", "kube-system","monitoring","logging"], namespaces: ["default", "kube-system", "monitoring", "logging", "metallb-system"],
}, },
alertmanager+:: { alertmanager+:: {
name: 'main',
config: |||
global:
resolve_timeout: 5m
route:
group_by: ['job']
group_wait: 30s
group_interval: 5m
repeat_interval: 12h
receiver: 'null'
routes:
- match:
alertname: DeadMansSwitch
receiver: 'null'
receivers:
- name: 'null'
|||,
replicas: 1, replicas: 1,
// Configure External URL's
alertmanager+: {
spec+: {
externalUrl: $._config.urls.alert_externalUrl,
},
},
}, },
kubeStateMetrics+:: { kubeStateMetrics+:: {
@ -89,13 +44,13 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
grafana+:: { grafana+:: {
config: { config: {
sections: { sections: {
database: { path: '/data/grafana.db' }, // database: { path: '/data/grafana.db' },
paths: { // paths: {
data: '/var/lib/grafana', // data: '/var/lib/grafana',
logs: '/var/lib/grafana/log', // logs: '/var/lib/grafana/log',
plugins: '/var/lib/grafana/plugins', // plugins: '/var/lib/grafana/plugins',
provisioning: '/etc/grafana/provisioning', // provisioning: '/etc/grafana/provisioning',
}, // },
session: { provider: 'memory' }, session: { provider: 'memory' },
'auth.basic': {enabled: false}, 'auth.basic': {enabled: false},
'auth.anonymous': {enabled: false}, 'auth.anonymous': {enabled: false},
@ -111,15 +66,13 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
}, },
}, },
}, },
},
//--------------------------------------- //---------------------------------------
// End of _config // End of _config
//--------------------------------------- //---------------------------------------
},
prometheus+:: { prometheus+:: {
local pvc = k.core.v1.persistentVolumeClaim, local pvc = k.core.v1.persistentVolumeClaim,
prometheus+: { prometheus+: {
spec+: { spec+: {
retention: '15d', retention: '15d',
@ -128,26 +81,31 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
volumeClaimTemplate: volumeClaimTemplate:
pvc.new() + pvc.new() +
pvc.mixin.spec.withAccessModes('ReadWriteOnce') + pvc.mixin.spec.withAccessModes('ReadWriteOnce') +
pvc.mixin.spec.resources.withRequests({ storage: '20Gi' }) + pvc.mixin.spec.resources.withRequests({ storage: '20Gi' })
pvc.mixin.spec.withStorageClassName('nfs-ssd-node1'), # Uncomment below to define a StorageClass name
#+ pvc.mixin.spec.withStorageClassName('nfs-master-ssd'),
}, },
}, },
}, },
}, },
# Override command for Grafana to load ini from correct path # Override command for Grafana persist data
// grafana+:: { // grafana+:: {
// deployment+:
// {
// local pvc = k.core.v1.persistentVolumeClaim, // local pvc = k.core.v1.persistentVolumeClaim,
// spec+: { // local deployment = k.apps.v1beta2.deployment,
// volumeClaimTemplate: // local container = deployment.mixin.spec.template.spec.containersType,
// pvc.new() + // local containerVolumeMount = container.volumeMountsType,
// pvc.mixin.metadata.withNamespace($._config.namespace) + // local volume = deployment.mixin.spec.template.spec.volumesType,
// local grafanaStorage = pvc.new() + pvc.mixin.metadata.withNamespace($._config.namespace) +
// pvc.mixin.metadata.withName("grafana-storage") + // pvc.mixin.metadata.withName("grafana-storage") +
// pvc.mixin.spec.withAccessModes('ReadWriteMany') + // pvc.mixin.spec.withAccessModes('ReadWriteMany') +
// pvc.mixin.spec.resources.withRequests({ storage: '2Gi' }) + // pvc.mixin.spec.resources.withRequests({ storage: '2Gi' }),
// pvc.mixin.spec.withStorageClassName('nfs-ssd-node1'), // deployment+: {
// // local storageVolumeName = grafanaStorage,
// // local storageVolume = volume.fromPersistentVolumeClaim(grafanaStorage),
// // },
// // {
// spec+: {
// template+: { // template+: {
// spec+: { // spec+: {
// containers: // containers:
@ -155,43 +113,53 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
// function(c) // function(c)
// if c.name == 'grafana' then // if c.name == 'grafana' then
// c { // c {
// args+: [ // volumeMounts+: [
// '-config=/etc/grafana/grafana.ini', // containerVolumeMount.new("grafana-storage", "/var/lib/grafana"),
// ], // ],
// } // }
// else // else
// c, // c,
// super.containers, // super.containers,
// ), // ),
// volumes+: [
// volume.fromPersistentVolumeClaim(grafanaStorage, "grafana-storage"),
// ],
// }, // },
// }, // },
// }, // },
// }, // },
// }, // },
// Override command for addon-resizer due to change from parameter --threshold to --acceptance-offset // Add custom dashboards
grafanaDashboards+:: {
'kubernetes-cluster-dashboard.json': (import 'grafana-dashboards/kubernetes-cluster-dashboard.json'),
'prometheus-dashboard.json': (import 'grafana-dashboards/prometheus-dashboard.json'),
'traefik-dashboard.json': (import 'grafana-dashboards/traefik-dashboard.json'),
},
kubeStateMetrics+:: { kubeStateMetrics+:: {
// Override command for addon-resizer due to change from parameter --threshold to --acceptance-offset
deployment+: { deployment+: {
spec+: { spec+: {
template+: { template+: {
spec+: { spec+: {
containers: containers:
std.filterMap( std.map(
function(c) c.name == 'addon-resizer',
function(c) function(c)
if std.startsWith(c.name, 'addon-resizer') then if std.startsWith(c.name, 'addon-resizer') then
c { c {
command: [ command: [
'/pod_nanny', '/pod_nanny',
'--container=kube-state-metrics', '--container=kube-state-metrics',
'--cpu=' + $._config.kubeStateMetrics.baseCPU, '--cpu=100m',
'--extra-cpu=' + $._config.kubeStateMetrics.cpuPerNode, '--extra-cpu=2m',
'--memory=' + $._config.kubeStateMetrics.baseMemory, '--memory=150Mi',
'--extra-memory=' + $._config.kubeStateMetrics.memoryPerNode, '--extra-memory=30Mi',
'--acceptance-offset=5', '--acceptance-offset=5',
'--deployment=kube-state-metrics', '--deployment=kube-state-metrics',
], ],
}, }
else
c,
super.containers, super.containers,
), ),
}, },
@ -212,11 +180,6 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
ingress.new() + ingress.new() +
ingress.mixin.metadata.withName('alertmanager-main') + ingress.mixin.metadata.withName('alertmanager-main') +
ingress.mixin.metadata.withNamespace($._config.namespace) + ingress.mixin.metadata.withNamespace($._config.namespace) +
// ingress.mixin.metadata.withAnnotations({
// 'nginx.ingress.kubernetes.io/auth-type': 'basic',
// 'nginx.ingress.kubernetes.io/auth-secret': 'basic-auth',
// 'nginx.ingress.kubernetes.io/auth-realm': 'Authentication Required',
// }) +
ingress.mixin.spec.withRules( ingress.mixin.spec.withRules(
ingressRule.new() + ingressRule.new() +
ingressRule.withHost($._config.urls.alert_ingress) + ingressRule.withHost($._config.urls.alert_ingress) +
@ -231,11 +194,6 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
ingress.new() + ingress.new() +
ingress.mixin.metadata.withName('grafana') + ingress.mixin.metadata.withName('grafana') +
ingress.mixin.metadata.withNamespace($._config.namespace) + ingress.mixin.metadata.withNamespace($._config.namespace) +
// ingress.mixin.metadata.withAnnotations({
// 'nginx.ingress.kubernetes.io/auth-type': 'basic',
// 'nginx.ingress.kubernetes.io/auth-secret': 'basic-auth',
// 'nginx.ingress.kubernetes.io/auth-realm': 'Authentication Required',
// }) +
ingress.mixin.spec.withRules( ingress.mixin.spec.withRules(
ingressRule.new() + ingressRule.new() +
ingressRule.withHost($._config.urls.grafana_ingress) + ingressRule.withHost($._config.urls.grafana_ingress) +
@ -250,11 +208,6 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
ingress.new() + ingress.new() +
ingress.mixin.metadata.withName('prometheus-k8s') + ingress.mixin.metadata.withName('prometheus-k8s') +
ingress.mixin.metadata.withNamespace($._config.namespace) + ingress.mixin.metadata.withNamespace($._config.namespace) +
// ingress.mixin.metadata.withAnnotations({
// 'nginx.ingress.kubernetes.io/auth-type': 'basic',
// 'nginx.ingress.kubernetes.io/auth-secret': 'basic-auth',
// 'nginx.ingress.kubernetes.io/auth-realm': 'Authentication Required',
// }) +
ingress.mixin.spec.withRules( ingress.mixin.spec.withRules(
ingressRule.new() + ingressRule.new() +
ingressRule.withHost($._config.urls.prom_ingress) + ingressRule.withHost($._config.urls.prom_ingress) +
@ -265,17 +218,32 @@ local kp = (import 'kube-prometheus/kube-prometheus.libsonnet') + {
httpIngressPath.mixin.backend.withServicePort('web') httpIngressPath.mixin.backend.withServicePort('web')
), ),
), ),
}, // 'grafana-external':
}; // // Example external ingress with authentication
// + { // ingress.new() +
// Create basic auth secret - replace 'auth' file with your own // ingress.mixin.metadata.withName('grafana-external') +
// Create with htpasswd -c auth [USERNAME] // ingress.mixin.metadata.withNamespace($._config.namespace) +
// ingress+:: { // ingress.mixin.metadata.withLabels({'traffic-type': 'external'}) +
// ingress.mixin.metadata.withAnnotations({
// 'ingress.kubernetes.io/auth-type': 'basic',
// 'ingress.kubernetes.io/auth-secret': 'basic-auth',
// }) +
// ingress.mixin.spec.withRules(
// ingressRule.new() +
// ingressRule.withHost($._config.urls.grafana_ingress_external) +
// ingressRule.mixin.http.withPaths(
// httpIngressPath.new() +
// httpIngressPath.withPath('/') +
// httpIngressPath.mixin.backend.withServiceName('grafana') +
// httpIngressPath.mixin.backend.withServicePort('http')
// ),
// ),
// 'basic-auth-secret': // 'basic-auth-secret':
// // First generate the auth secret with gen_auth.sh script
// secret.new('basic-auth', { auth: std.base64(importstr 'auth') }) + // secret.new('basic-auth', { auth: std.base64(importstr 'auth') }) +
// secret.mixin.metadata.withNamespace($._config.namespace), // secret.mixin.metadata.withNamespace($._config.namespace),
// }, },
// }; };
{ ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } + { ['00namespace-' + name]: kp.kubePrometheus[name] for name in std.objectFields(kp.kubePrometheus) } +
{ ['0prometheus-operator-' + name]: kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator) } + { ['0prometheus-operator-' + name]: kp.prometheusOperator[name] for name in std.objectFields(kp.prometheusOperator) } +