Skip to content

Commit

Permalink
Update loki dashboard
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
  • Loading branch information
mjtrangoni committed Jan 11, 2024
1 parent fc486ed commit bd147dd
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 49 deletions.
2 changes: 1 addition & 1 deletion monitoring/configs/dashboards/cluster.json
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@
]
},
"timezone": "",
"title": "Flux Cluster Stats",
"title": "Flux / Cluster Stats",
"uid": "flux-cluster",
"version": 4,
"weekStart": ""
Expand Down
2 changes: 1 addition & 1 deletion monitoring/configs/dashboards/control-plane.json
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@
]
},
"timezone": "",
"title": "Flux Control Plane",
"title": "Flux / Control Plane",
"uid": "flux-control-plane",
"version": 2,
"weekStart": ""
Expand Down
133 changes: 86 additions & 47 deletions monitoring/configs/dashboards/logs.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,27 @@
},
"description": "Flux logs collected from Kubernetes, stored in Loki",
"editable": true,
"gnetId": null,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 29,
"iteration": 1653748775696,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": "${DS_LOKI}",
"datasource": {
"type": "loki",
"uid": "${DS_LOKI}"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
Expand All @@ -74,6 +79,7 @@
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
Expand Down Expand Up @@ -117,8 +123,9 @@
"options": {
"legend": {
"calcs": [],
"displayMode": "hidden",
"placement": "bottom"
"displayMode": "list",
"placement": "bottom",
"showLegend": false
},
"tooltip": {
"mode": "single",
Expand All @@ -127,18 +134,26 @@
},
"targets": [
{
"datasource": "${DS_LOKI}",
"expr": "sum(count_over_time({namespace=~\"$namespace\", stream=~\"$stream\", app =~\"$controller\"} | json | __error__!=\"JSONParserErr\" | level=~\"$level\" |= \"$query\" [$__interval]))",
"datasource": {
"type": "loki",
"uid": "${DS_LOKI}"
},
"editorMode": "code",
"expr": "sum(count_over_time({namespace=~\"$namespace\", stream=~\"$stream\", app =~\"$controller\"} | json | __error__!=\"JSONParserErr\" |~ \"\\\"level\\\":\\\"$level\\\"\" |= \"$query\" [$__interval]))",
"instant": false,
"legendFormat": "Log count",
"queryType": "range",
"range": true,
"refId": "A"
}
],
"type": "timeseries"
},
{
"datasource": "${DS_LOKI}",
"datasource": {
"type": "loki",
"uid": "${DS_LOKI}"
},
"description": "Logs from services running in Kubernetes",
"gridPos": {
"h": 25,
Expand All @@ -149,27 +164,31 @@
"id": 2,
"options": {
"dedupStrategy": "numbers",
"enableLogDetails": false,
"prettifyLogMessage": true,
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": false,
"showTime": false,
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": false
"wrapLogMessage": true
},
"targets": [
{
"datasource": "${DS_LOKI}",
"expr": "{namespace=~\"$namespace\", stream=~\"$stream\", app =~\"$controller\"} | json | __error__!=\"JSONParserErr\" | level=~\"$level\" |= \"$query\"",
"datasource": {
"type": "loki",
"uid": "${DS_LOKI}"
},
"editorMode": "code",
"expr": "{namespace=~\"$namespace\", stream=~\"$stream\", app =~\"$controller\"} | json | __error__!=\"JSONParserErr\" |~ \"\\\"level\\\":\\\"$level\\\"\" |= \"$query\"",
"queryType": "range",
"refId": "A"
}
],
"type": "logs"
}
],
"refresh": "10s",
"schemaVersion": 36,
"style": "light",
"schemaVersion": 38,
"tags": [
"flux"
],
Expand Down Expand Up @@ -199,7 +218,7 @@
{
"allValue": "info|error",
"current": {
"selected": false,
"selected": true,
"text": "All",
"value": "$__all"
},
Expand Down Expand Up @@ -231,23 +250,18 @@
},
{
"allValue": ".+",
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
"current": {},
"datasource": {
"type": "loki",
"uid": "${DS_LOKI}"
},
"datasource": "${DS_LOKI}",
"definition": "label_values(app)",
"definition": "label_values(namespace)",
"hide": 0,
"includeAll": true,
"multi": true,
"name": "controller",
"name": "namespace",
"options": [],
"query": "label_values(app)",
"query": "label_values(namespace)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand All @@ -265,14 +279,22 @@
"flux-system"
]
},
"datasource": "${DS_LOKI}",
"definition": "label_values(namespace)",
"datasource": {
"type": "loki",
"uid": "${DS_LOKI}"
},
"definition": "",
"hide": 0,
"includeAll": true,
"multi": true,
"name": "namespace",
"name": "controller",
"options": [],
"query": "label_values(namespace)",
"query": {
"label": "app",
"refId": "LokiVariableQueryEditor-VariableQuery",
"stream": "{namespace=~\"$namespace\"}",
"type": 1
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
Expand All @@ -282,23 +304,39 @@
{
"allValue": ".+",
"current": {
"selected": false,
"text": "All",
"value": "$__all"
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": "${DS_LOKI}",
"definition": "label_values(stream)",
"hide": 0,
"includeAll": true,
"multi": true,
"name": "stream",
"options": [],
"query": "label_values(stream)",
"refresh": 1,
"regex": "",
"options": [
{
"selected": true,
"text": "All",
"value": "$__all"
},
{
"selected": false,
"text": "stdout",
"value": "stdout"
},
{
"selected": false,
"text": "stderr",
"value": "stderr"
}
],
"query": "stdout,stderr",
"queryValue": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
"type": "custom"
},
{
"current": {
Expand Down Expand Up @@ -326,7 +364,8 @@
},
"timepicker": {},
"timezone": "",
"title": "Flux Logs",
"title": "Flux / Logs",
"uid": "flux-logs",
"version": 2
"version": 1,
"weekStart": ""
}

0 comments on commit bd147dd

Please sign in to comment.