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,281 +1,249 @@
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",
urls+:: { urls+:: {
prom_externalUrl: 'http://prometheus.internal.carlosedp.com', prom_externalUrl: 'http://prometheus.internal.carlosedp.com',
alert_externalUrl: 'http://alertmanager.internal.carlosedp.com', alert_externalUrl: 'http://alertmanager.internal.carlosedp.com',
grafana_externalUrl: 'http://grafana.internal.carlosedp.com/', grafana_externalUrl: 'http://grafana.internal.carlosedp.com/',
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+:: {
names: 'k8s',
replicas: 1,
namespaces: ["default", "kube-system","monitoring","logging"],
},
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,
// Configure External URL's
alertmanager+: {
spec+: {
externalUrl: $._config.urls.alert_externalUrl,
}, },
},
},
kubeStateMetrics+:: { prometheus+:: {
collectors: '', // empty string gets a default set names: 'k8s',
scrapeInterval: '30s', replicas: 1,
scrapeTimeout: '30s', namespaces: ["default", "kube-system", "monitoring", "logging", "metallb-system"],
},
baseCPU: '100m', alertmanager+:: {
baseMemory: '150Mi', replicas: 1,
cpuPerNode: '2m', },
memoryPerNode: '30Mi',
},
grafana+:: { kubeStateMetrics+:: {
config: { collectors: '', // empty string gets a default set
sections: { scrapeInterval: '30s',
database: { path: '/data/grafana.db' }, scrapeTimeout: '30s',
paths: {
data: '/var/lib/grafana', baseCPU: '100m',
logs: '/var/lib/grafana/log', baseMemory: '150Mi',
plugins: '/var/lib/grafana/plugins', cpuPerNode: '2m',
provisioning: '/etc/grafana/provisioning', memoryPerNode: '30Mi',
}, },
session: { provider: 'memory' },
'auth.basic': {enabled: false}, grafana+:: {
'auth.anonymous': {enabled: false}, config: {
smtp: { sections: {
enabled: true, // database: { path: '/data/grafana.db' },
host: 'smtp-server.monitoring.svc:25', // paths: {
user: '', // data: '/var/lib/grafana',
password: '', // logs: '/var/lib/grafana/log',
from_address:'carlosedp@gmail.com', // plugins: '/var/lib/grafana/plugins',
from_name: 'Grafana Alert', // provisioning: '/etc/grafana/provisioning',
skip_verify: true // },
session: { provider: 'memory' },
'auth.basic': {enabled: false},
'auth.anonymous': {enabled: false},
smtp: {
enabled: true,
host: 'smtp-server.monitoring.svc:25',
user: '',
password: '',
from_address:'carlosedp@gmail.com',
from_name: 'Grafana Alert',
skip_verify: true
},
},
}, },
}, },
},
}, },
//--------------------------------------- //---------------------------------------
// 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', externalUrl: $._config.urls.prom_externalUrl,
externalUrl: $._config.urls.prom_externalUrl, storage: {
storage: { 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' }) + # Uncomment below to define a StorageClass name
pvc.mixin.spec.withStorageClassName('nfs-ssd-node1'), #+ 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 deployment = k.apps.v1beta2.deployment,
// local pvc = k.core.v1.persistentVolumeClaim, // local container = deployment.mixin.spec.template.spec.containersType,
// spec+: { // local containerVolumeMount = container.volumeMountsType,
// volumeClaimTemplate: // local volume = deployment.mixin.spec.template.spec.volumesType,
// pvc.new() + // local grafanaStorage = pvc.new() + pvc.mixin.metadata.withNamespace($._config.namespace) +
// 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' }) + // deployment+: {
// pvc.mixin.spec.withStorageClassName('nfs-ssd-node1'), // // local storageVolumeName = grafanaStorage,
// template+: { // // local storageVolume = volume.fromPersistentVolumeClaim(grafanaStorage),
// spec+: { // // },
// containers: // // {
// std.map( // spec+: {
// function(c) // template+: {
// if c.name == 'grafana' then // spec+: {
// c { // containers:
// args+: [ // std.map(
// '-config=/etc/grafana/grafana.ini', // function(c)
// ], // if c.name == 'grafana' then
// } // c {
// else // volumeMounts+: [
// c, // containerVolumeMount.new("grafana-storage", "/var/lib/grafana"),
// super.containers, // ],
// ), // }
// }, // else
// }, // c,
// }, // 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
kubeStateMetrics+:: { grafanaDashboards+:: {
deployment+: { 'kubernetes-cluster-dashboard.json': (import 'grafana-dashboards/kubernetes-cluster-dashboard.json'),
spec+: { 'prometheus-dashboard.json': (import 'grafana-dashboards/prometheus-dashboard.json'),
template+: { 'traefik-dashboard.json': (import 'grafana-dashboards/traefik-dashboard.json'),
spec+: { },
containers: kubeStateMetrics+:: {
std.filterMap( // Override command for addon-resizer due to change from parameter --threshold to --acceptance-offset
function(c) c.name == 'addon-resizer', deployment+: {
function(c) spec+: {
if std.startsWith(c.name, 'addon-resizer') then template+: {
c { spec+: {
command: [ containers:
'/pod_nanny', std.map(
'--container=kube-state-metrics', function(c)
'--cpu=' + $._config.kubeStateMetrics.baseCPU, if std.startsWith(c.name, 'addon-resizer') then
'--extra-cpu=' + $._config.kubeStateMetrics.cpuPerNode, c {
'--memory=' + $._config.kubeStateMetrics.baseMemory, command: [
'--extra-memory=' + $._config.kubeStateMetrics.memoryPerNode, '/pod_nanny',
'--acceptance-offset=5', '--container=kube-state-metrics',
'--deployment=kube-state-metrics', '--cpu=100m',
], '--extra-cpu=2m',
'--memory=150Mi',
'--extra-memory=30Mi',
'--acceptance-offset=5',
'--deployment=kube-state-metrics',
],
}
else
c,
super.containers,
),
}, },
super.containers, },
), },
},
}, },
},
}, },
},
// Create ingress objects per application // Create ingress objects per application
ingress+: { ingress+: {
local secret = k.core.v1.secret, local secret = k.core.v1.secret,
local ingress = k.extensions.v1beta1.ingress, local ingress = k.extensions.v1beta1.ingress,
local ingressTls = ingress.mixin.spec.tlsType, local ingressTls = ingress.mixin.spec.tlsType,
local ingressRule = ingress.mixin.spec.rulesType, local ingressRule = ingress.mixin.spec.rulesType,
local httpIngressPath = ingressRule.mixin.http.pathsType, local httpIngressPath = ingressRule.mixin.http.pathsType,
'alertmanager-main': 'alertmanager-main':
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({ ingress.mixin.spec.withRules(
// 'nginx.ingress.kubernetes.io/auth-type': 'basic', ingressRule.new() +
// 'nginx.ingress.kubernetes.io/auth-secret': 'basic-auth', ingressRule.withHost($._config.urls.alert_ingress) +
// 'nginx.ingress.kubernetes.io/auth-realm': 'Authentication Required', ingressRule.mixin.http.withPaths(
// }) + httpIngressPath.new() +
ingress.mixin.spec.withRules( httpIngressPath.withPath('/') +
ingressRule.new() + httpIngressPath.mixin.backend.withServiceName('alertmanager-main') +
ingressRule.withHost($._config.urls.alert_ingress) + httpIngressPath.mixin.backend.withServicePort('web')
ingressRule.mixin.http.withPaths( ),
httpIngressPath.new() + ),
httpIngressPath.withPath('/') + 'grafana':
httpIngressPath.mixin.backend.withServiceName('alertmanager-main') + ingress.new() +
httpIngressPath.mixin.backend.withServicePort('web') ingress.mixin.metadata.withName('grafana') +
), ingress.mixin.metadata.withNamespace($._config.namespace) +
), ingress.mixin.spec.withRules(
'grafana': ingressRule.new() +
ingress.new() + ingressRule.withHost($._config.urls.grafana_ingress) +
ingress.mixin.metadata.withName('grafana') + ingressRule.mixin.http.withPaths(
ingress.mixin.metadata.withNamespace($._config.namespace) + httpIngressPath.new() +
// ingress.mixin.metadata.withAnnotations({ httpIngressPath.withPath('/') +
// 'nginx.ingress.kubernetes.io/auth-type': 'basic', httpIngressPath.mixin.backend.withServiceName('grafana') +
// 'nginx.ingress.kubernetes.io/auth-secret': 'basic-auth', httpIngressPath.mixin.backend.withServicePort('http')
// 'nginx.ingress.kubernetes.io/auth-realm': 'Authentication Required', ),
// }) + ),
ingress.mixin.spec.withRules( 'prometheus-k8s':
ingressRule.new() + ingress.new() +
ingressRule.withHost($._config.urls.grafana_ingress) + ingress.mixin.metadata.withName('prometheus-k8s') +
ingressRule.mixin.http.withPaths( ingress.mixin.metadata.withNamespace($._config.namespace) +
httpIngressPath.new() + ingress.mixin.spec.withRules(
httpIngressPath.withPath('/') + ingressRule.new() +
httpIngressPath.mixin.backend.withServiceName('grafana') + ingressRule.withHost($._config.urls.prom_ingress) +
httpIngressPath.mixin.backend.withServicePort('http') ingressRule.mixin.http.withPaths(
), httpIngressPath.new() +
), httpIngressPath.withPath('/') +
'prometheus-k8s': httpIngressPath.mixin.backend.withServiceName('prometheus-k8s') +
ingress.new() + httpIngressPath.mixin.backend.withServicePort('web')
ingress.mixin.metadata.withName('prometheus-k8s') + ),
ingress.mixin.metadata.withNamespace($._config.namespace) + ),
// ingress.mixin.metadata.withAnnotations({ // 'grafana-external':
// 'nginx.ingress.kubernetes.io/auth-type': 'basic', // // Example external ingress with authentication
// 'nginx.ingress.kubernetes.io/auth-secret': 'basic-auth', // ingress.new() +
// 'nginx.ingress.kubernetes.io/auth-realm': 'Authentication Required', // ingress.mixin.metadata.withName('grafana-external') +
// }) + // ingress.mixin.metadata.withNamespace($._config.namespace) +
ingress.mixin.spec.withRules( // ingress.mixin.metadata.withLabels({'traffic-type': 'external'}) +
ingressRule.new() + // ingress.mixin.metadata.withAnnotations({
ingressRule.withHost($._config.urls.prom_ingress) + // 'ingress.kubernetes.io/auth-type': 'basic',
ingressRule.mixin.http.withPaths( // 'ingress.kubernetes.io/auth-secret': 'basic-auth',
httpIngressPath.new() + // }) +
httpIngressPath.withPath('/') + // ingress.mixin.spec.withRules(
httpIngressPath.mixin.backend.withServiceName('prometheus-k8s') + // ingressRule.new() +
httpIngressPath.mixin.backend.withServicePort('web') // 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')
// Create basic auth secret - replace 'auth' file with your own // ),
// Create with htpasswd -c auth [USERNAME] // ),
// ingress+:: { // '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) } +