kubernetes-yaml/learn/learn-kubernetes-master/kiamol/ch14/grafana/update/grafana-dashboard-numbers-api-v2.yaml

634 lines
17 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboard-numbers-api
namespace: kiamol-ch14-monitoring
data:
numbers-api.json: |-
{
"annotations": {
"list": [
{
"$$hashKey": "object:39",
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 8,
"title": "Status",
"type": "row"
},
{
"datasource": "Prometheus",
"gridPos": {
"h": 6,
"w": 5,
"x": 0,
"y": 1
},
"id": 4,
"options": {
"colorMode": "value",
"fieldOptions": {
"calcs": [
"lastNotNull"
],
"defaults": {
"mappings": [
{
"from": "",
"id": 1,
"operator": "",
"text": "OK",
"to": "",
"type": 1,
"value": "1"
},
{
"from": "",
"id": 2,
"operator": "",
"text": "NOTOK",
"to": "",
"type": 1,
"value": "0"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "red",
"value": 0
},
{
"color": "green",
"value": 1
}
]
}
},
"overrides": [],
"values": false
},
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto"
},
"pluginVersion": "6.7.4",
"targets": [
{
"expr": "probe_success{job=\"numbers-api\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Status",
"type": "stat"
},
{
"datasource": "Prometheus",
"gridPos": {
"h": 6,
"w": 4,
"x": 5,
"y": 1
},
"id": 2,
"options": {
"colorMode": "value",
"fieldOptions": {
"calcs": [
"lastNotNull"
],
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 400
}
]
}
},
"overrides": [],
"values": false
},
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto"
},
"pluginVersion": "6.7.4",
"targets": [
{
"expr": "probe_http_status_code{job=\"numbers-api\"}",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "HTTP Status Code",
"type": "stat"
},
{
"datasource": "Prometheus",
"gridPos": {
"h": 6,
"w": 4,
"x": 9,
"y": 1
},
"id": 13,
"options": {
"fieldOptions": {
"calcs": [
"mean"
],
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percent"
},
"overrides": [],
"values": false
},
"orientation": "auto",
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "6.7.4",
"targets": [
{
"expr": "sum(rate(container_cpu_usage_seconds_total{container_label_io_kubernetes_pod_name=~\"numbers-api.*\", container_label_io_kubernetes_container_name=\"api\"}[5m])) / sum (machine_cpu_cores) * 100",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Cluster CPU Usage",
"type": "gauge"
},
{
"datasource": "Prometheus",
"gridPos": {
"h": 6,
"w": 4,
"x": 13,
"y": 1
},
"id": 14,
"options": {
"fieldOptions": {
"calcs": [
"mean"
],
"defaults": {
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percent"
},
"overrides": [],
"values": false
},
"orientation": "auto",
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "6.7.4",
"targets": [
{
"expr": "sum (container_memory_working_set_bytes{container_label_io_kubernetes_pod_name=~\"numbers-api.*\", container_label_io_kubernetes_container_name=\"api\"}) / sum (kube_node_status_allocatable_memory_bytes) * 100",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Cluster Memory Usage",
"type": "gauge"
},
{
"collapsed": false,
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 7
},
"id": 10,
"panels": [],
"title": "Info",
"type": "row"
},
{
"columns": [],
"datasource": "Prometheus",
"fontSize": "100%",
"gridPos": {
"h": 3,
"w": 15,
"x": 0,
"y": 8
},
"id": 6,
"pageSize": null,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
},
"styles": [
{
"$$hashKey": "object:139",
"alias": "Time",
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "hidden"
},
{
"$$hashKey": "object:337",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "__name__",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:140",
"alias": "",
"align": "right",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"pattern": "instance",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1225",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "uid",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1272",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1317",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "job",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1479",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "host_ip",
"thresholds": [],
"type": "hidden",
"unit": "short"
}
],
"targets": [
{
"expr": "kube_pod_info{pod=~\"numbers-api.*\",job=\"kube-state-metrics\"} ",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Pod",
"transform": "table",
"type": "table"
},
{
"columns": [],
"datasource": "Prometheus",
"fontSize": "100%",
"gridPos": {
"h": 3,
"w": 5,
"x": 15,
"y": 8
},
"id": 11,
"pageSize": null,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
},
"styles": [
{
"$$hashKey": "object:139",
"alias": "Time",
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "hidden"
},
{
"$$hashKey": "object:337",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "__name__",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:140",
"alias": "",
"align": "right",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"pattern": "instance",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1225",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "uid",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1272",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "Value",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1317",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "job",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1479",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "namespace",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"$$hashKey": "object:1797",
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "pod",
"thresholds": [],
"type": "hidden",
"unit": "short"
}
],
"targets": [
{
"expr": "kube_pod_labels{pod=~\"numbers-api.*\"}",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Labels",
"transform": "table",
"type": "table"
}
],
"refresh": "30s",
"schemaVersion": 22,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Random Number API",
"uid": "Tb6isdMMk",
"variables": {
"list": []
},
"version": 1
}