{ "__inputs": [ { "name": "DS_KUBE-LOKI", "label": "Kube-loki", "description": "", "type": "datasource", "pluginId": "loki", "pluginName": "Loki" }, { "name": "DS_KUBE-PROMETHEUS", "label": "Kube-prometheus", "description": "", "type": "datasource", "pluginId": "prometheus", "pluginName": "Prometheus" } ], "__elements": {}, "__requires": [ { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "10.3.5" }, { "type": "datasource", "id": "loki", "name": "Loki", "version": "1.0.0" }, { "type": "datasource", "id": "prometheus", "name": "Prometheus", "version": "1.0.0" }, { "type": "panel", "id": "table", "name": "Table", "version": "" }, { "type": "panel", "id": "timeseries", "name": "Time series", "version": "" } ], "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": null, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "loki", "uid": "${DS_KUBE-LOKI}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "bars", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 10, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unitScale": true }, "overrides": [] }, "gridPos": { "h": 8, "w": 24, "x": 0, "y": 0 }, "id": 2, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "loki", "uid": "${DS_KUBE-LOKI}" }, "editorMode": "builder", "expr": "count(rate({job=\"$job\"} | json | kubernetes_namespace_name =~ `$namespaces` | kubernetes_container_name =~ `.*$component.*` | kubernetes_labels_app_kubernetes_io_component =~ `$component` | log =~ `.*$log_contains.*` | kubernetes_pod_name =~ `.*.$pod_name_contains.*` [$__auto]))", "legendFormat": "Count", "queryType": "range", "refId": "A" } ], "title": "Timeline", "transformations": [], "type": "timeseries" }, { "datasource": { "type": "loki", "uid": "${DS_KUBE-LOKI}" }, "fieldConfig": { "defaults": { "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": true }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unitScale": false }, "overrides": [ { "matcher": { "id": "byName", "options": "log" }, "properties": [ { "id": "custom.width", "value": 1107 } ] }, { "matcher": { "id": "byName", "options": "time" }, "properties": [ { "id": "custom.width", "value": 208 } ] }, { "matcher": { "id": "byName", "options": "container" }, "properties": [ { "id": "custom.width", "value": 133 } ] }, { "matcher": { "id": "byName", "options": "namespace" }, "properties": [ { "id": "custom.width", "value": 142 } ] }, { "matcher": { "id": "byName", "options": "pod" }, "properties": [ { "id": "custom.width", "value": 310 } ] }, { "matcher": { "id": "byName", "options": "component" }, "properties": [ { "id": "custom.width", "value": 145 } ] } ] }, "gridPos": { "h": 13, "w": 24, "x": 0, "y": 8 }, "id": 1, "options": { "cellHeight": "md", "footer": { "countRows": false, "enablePagination": false, "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "time" } ] }, "pluginVersion": "10.3.5", "targets": [ { "datasource": { "type": "loki", "uid": "${DS_KUBE-LOKI}" }, "editorMode": "builder", "expr": "{job=\"$job\"} | json | kubernetes_namespace_name =~ `$namespaces` | kubernetes_container_name =~ `.*$component.*` | kubernetes_labels_app_kubernetes_io_component =~ `$component` | log =~ `.*$log_contains.*` | kubernetes_pod_name =~ `.*$pod_name_contains.*`", "legendFormat": "", "queryType": "range", "refId": "A" } ], "transformations": [ { "id": "extractFields", "options": { "source": "labels" } }, { "id": "filterFieldsByName", "options": { "include": { "names": [ "Time", "Line", "kubernetes_container_image", "kubernetes_container_name", "kubernetes_namespace_name", "kubernetes_pod_name", "log", "kubernetes_labels_app_kubernetes_io_component" ] } } }, { "id": "organize", "options": { "excludeByName": { "Line": true, "kubernetes_container_image": true }, "includeByName": {}, "indexByName": { "Line": 3, "Time": 0, "kubernetes_container_image": 7, "kubernetes_container_name": 6, "kubernetes_labels_app_kubernetes_io_component": 1, "kubernetes_namespace_name": 5, "kubernetes_pod_name": 4, "log": 2 }, "renameByName": { "Line": "line", "Time": "time", "kubernetes_container_image": "image", "kubernetes_container_name": "container", "kubernetes_labels_app_kubernetes_io_component": "component", "kubernetes_namespace_name": "namespace", "kubernetes_pod_name": "pod", "log": "" } } } ], "type": "table" } ], "refresh": "", "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "Kube-loki", "value": "P2895588539814C92" }, "hide": 0, "includeAll": false, "label": "Datasource", "multi": false, "name": "datasource", "options": [], "query": "loki", "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, "type": "datasource" }, { "current": { "selected": false, "text": "Kube-prometheus", "value": "P8D3620484E958841" }, "hide": 0, "includeAll": false, "label": "Metrics source", "multi": false, "name": "metrics_source", "options": [], "query": "prometheus", "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, "type": "datasource" }, { "current": {}, "datasource": { "type": "loki", "uid": "${DS_KUBE-LOKI}" }, "definition": "", "hide": 0, "includeAll": false, "label": "Job", "multi": false, "name": "job", "options": [], "query": { "label": "job", "refId": "LokiVariableQueryEditor-VariableQuery", "stream": "", "type": 1 }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": {}, "datasource": { "type": "prometheus", "uid": "${DS_KUBE-PROMETHEUS}" }, "definition": "label_values(kube_namespace_labels,exported_namespace)", "hide": 0, "includeAll": true, "label": "Namespaces", "multi": true, "name": "namespaces", "options": [], "query": { "qryType": 1, "query": "label_values(kube_namespace_labels,exported_namespace)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": {}, "datasource": { "type": "prometheus", "uid": "${DS_KUBE-PROMETHEUS}" }, "definition": "label_values(kube_pod_labels{exported_namespace=~\"$namespaces\"},label_app_kubernetes_io_component)", "hide": 0, "includeAll": true, "label": "Component", "multi": true, "name": "component", "options": [], "query": { "qryType": 1, "query": "label_values(kube_pod_labels{exported_namespace=~\"$namespaces\"},label_app_kubernetes_io_component)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "", "value": "" }, "hide": 0, "label": "Log contains", "name": "log_contains", "options": [ { "selected": true, "text": "", "value": "" } ], "query": "", "skipUrlSync": false, "type": "textbox" }, { "current": { "selected": false, "text": "", "value": "" }, "hide": 0, "label": "Pod name contains", "name": "pod_name_contains", "options": [ { "selected": true, "text": "", "value": "" } ], "query": "", "skipUrlSync": false, "type": "textbox" } ] }, "time": { "from": "now-30m", "to": "now" }, "timeRangeUpdatedDuringEditOrView": false, "timepicker": {}, "timezone": "", "title": "Pod logs", "uid": "e0a431f1-fd31-48ce-885b-079bba3bf58d", "version": 30, "weekStart": "" }