Skip to content

Commit

Permalink
feat: make container logs grafana more readable (#5476)
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj authored Aug 20, 2024
1 parent fe98d76 commit a0da353
Showing 1 changed file with 31 additions and 16 deletions.
47 changes: 31 additions & 16 deletions deployment/grafana-dashboards/Container-Logs.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"graphTooltip": 0,
"id": 54,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
Expand All @@ -39,12 +38,14 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMin": 0,
"barAlignment": 0,
"barWidthFactor": 0.6,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
Expand All @@ -53,6 +54,7 @@
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
Expand Down Expand Up @@ -107,6 +109,7 @@
"sort": "none"
}
},
"pluginVersion": "11.2.0-74515",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -135,7 +138,6 @@
"id": 4,
"panels": [],
"repeat": "service",
"repeatDirection": "h",
"title": "$service",
"type": "row"
},
Expand All @@ -144,6 +146,10 @@
"type": "loki",
"uid": "grafanacloud-logs"
},
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 13,
"w": 24,
Expand All @@ -154,21 +160,22 @@
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": false,
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": false
},
"pluginVersion": "11.2.0-74515",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "grafanacloud-logs"
},
"editorMode": "code",
"expr": "{container_name=\"$service\"} | json | __error__!=\"JSONParserErr\" | level>30 ",
"expr": "{container_name=\"$service\"} | json | regexp `(?P<requestId>[a-f0-9-]{36})`| line_format \"{{ .msg }}\" | __error__ != `JSONParserErr` | level > 30",
"hide": false,
"key": "Q-4f74f5b0-5837-415a-b726-56138193c25e-0",
"queryType": "range",
Expand All @@ -183,6 +190,10 @@
"type": "loki",
"uid": "grafanacloud-logs"
},
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 24,
Expand All @@ -200,14 +211,15 @@
"sortOrder": "Descending",
"wrapLogMessage": false
},
"pluginVersion": "11.2.0-74515",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "grafanacloud-logs"
},
"editorMode": "code",
"expr": "{container_name=\"$service\"} | json | __error__!=\"JSONParserErr\" ",
"expr": "{container_name=\"$service\"} | json | __error__ != `JSONParserErr` | regexp `(?P<requestId>[a-f0-9-]{36})` | line_format `{{ .msg }}`",
"queryType": "range",
"refId": "A"
}
Expand All @@ -216,28 +228,24 @@
"type": "logs"
}
],
"preload": false,
"refresh": "30s",
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"schemaVersion": 39,
"tags": ["kubernetes", "logs"],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": "rate-limiter",
"value": "rate-limiter"
"text": "graphql-api",
"value": "graphql-api"
},
"datasource": {
"type": "loki",
"uid": "grafanacloud-logs"
},
"definition": "",
"hide": 0,
"includeAll": false,
"label": "Service:",
"multi": false,
"name": "service",
"options": [],
"query": {
Expand All @@ -248,9 +256,16 @@
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"datasource": {
"type": "loki",
"uid": "grafanacloud-logs"
},
"filters": [],
"name": "Filters",
"type": "adhoc"
}
]
},
Expand All @@ -262,6 +277,6 @@
"timezone": "",
"title": "Container Logs",
"uid": "ih6KH0aVz",
"version": 8,
"version": 9,
"weekStart": ""
}

0 comments on commit a0da353

Please sign in to comment.