Skip to content

Commit 5f79d0e

Browse files
authored
Merge pull request #1 from onzack/dashboard-cri-format
✨ Adding Loki query constant for CRI and pure JSON compatibility
2 parents 0dd3303 + 10ab343 commit 5f79d0e

2 files changed

Lines changed: 31 additions & 11 deletions

File tree

helm/hubble-observer/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: hubble-observer
33
description: A Helm chart for Hubble Observer - A small observability component that monitors network flows within Cilium.
44
type: application
5-
version: 1.1.3
5+
version: 1.1.4
66
appVersion: "1.16.4"
77
keywords:
88
- networking

helm/hubble-observer/dashboard/cilium-hubble-flows.json

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
"uid": "${DS_LOKI}"
172172
},
173173
"editorMode": "code",
174-
"expr": "sum(\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | json | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__range])\n)",
174+
"expr": "sum(\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | $cri_logparser | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__range])\n)",
175175
"legendFormat": "",
176176
"queryType": "instant",
177177
"refId": "A"
@@ -328,7 +328,7 @@
328328
"uid": "${DS_LOKI}"
329329
},
330330
"editorMode": "code",
331-
"expr": "sum by(flow_verdict) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | json | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__range])\n)",
331+
"expr": "sum by(flow_verdict) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | $cri_logparser | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__range])\n)",
332332
"hide": false,
333333
"legendFormat": "{{flow_verdict}}",
334334
"queryType": "range",
@@ -402,7 +402,7 @@
402402
"uid": "${DS_LOKI}"
403403
},
404404
"editorMode": "code",
405-
"expr": "sum by(flow_traffic_direction) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | json | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__range])\n)",
405+
"expr": "sum by(flow_traffic_direction) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | $cri_logparser | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__range])\n)",
406406
"hide": false,
407407
"legendFormat": "",
408408
"queryType": "instant",
@@ -479,7 +479,7 @@
479479
"uid": "${DS_LOKI}"
480480
},
481481
"editorMode": "code",
482-
"expr": "sum by(flow_source_namespace) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | json | flow_source_namespace!=\"\" | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__range])\n)",
482+
"expr": "sum by(flow_source_namespace) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | $cri_logparser | flow_source_namespace!=\"\" | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__range])\n)",
483483
"hide": false,
484484
"legendFormat": "",
485485
"queryType": "instant",
@@ -556,7 +556,7 @@
556556
"uid": "${DS_LOKI}"
557557
},
558558
"editorMode": "code",
559-
"expr": "sum by(flow_destination_name) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | json | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\" | json flow_destination_name=\"flow.destination_names[0]\" | flow_destination_name!=\"\" \n [$__range])\n)",
559+
"expr": "sum by(flow_destination_name) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | $cri_logparser | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\" | json flow_destination_name=\"flow.destination_names[0]\" | flow_destination_name!=\"\" \n [$__range])\n)",
560560
"hide": false,
561561
"legendFormat": "",
562562
"queryType": "instant",
@@ -749,7 +749,7 @@
749749
"uid": "${DS_LOKI}"
750750
},
751751
"editorMode": "code",
752-
"expr": "sum by(flow_verdict) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | json | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__auto])\n)",
752+
"expr": "sum by(flow_verdict) (\n count_over_time(\n {namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n | $cri_logparser | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\"\n [$__auto])\n)",
753753
"hide": false,
754754
"legendFormat": "{{flow_verdict}}",
755755
"queryType": "range",
@@ -1096,7 +1096,7 @@
10961096
"uid": "${DS_LOKI}"
10971097
},
10981098
"editorMode": "code",
1099-
"expr": "{namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n| json | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\" | json flow_destination_name=\"flow.destination_names[0]\"",
1099+
"expr": "{namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n| $cri_logparser | flow_source_namespace=~\"$sourcenamespace\" | flow_destination_namespace=~\"$destinationnamespace\" | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\" | json flow_destination_name=\"flow.destination_names[0]\"",
11001100
"maxLines": 100,
11011101
"queryType": "range",
11021102
"refId": "A"
@@ -1282,7 +1282,7 @@
12821282
"uid": "${DS_LOKI}"
12831283
},
12841284
"editorMode": "code",
1285-
"expr": "{namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n| json | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\" | json flow_destination_name=\"flow.destination_names[0]\"",
1285+
"expr": "{namespace=\"$hubbleobservernamespace\",container=\"hubble-observer\"} |~ `(?i)$searchregex` !~ `(?i)$excluderegex`\n| $cri_logparser | flow_traffic_direction=~\"$direction\" | flow_IP_ipVersion=~\"$ipversion\" | json flow_destination_name=\"flow.destination_names[0]\"",
12861286
"legendFormat": "",
12871287
"queryType": "range",
12881288
"refId": "A"
@@ -1488,6 +1488,26 @@
14881488
"selected": false
14891489
}
14901490
]
1491+
},
1492+
{
1493+
"hide": 2,
1494+
"name": "cri_logparser",
1495+
"description": "Parses CRI log lines, extracting timestamp, stream, flags, and message. Only the message part is taken if it matches, then it is parsed as JSON.",
1496+
"query": "regexp `^(?:(?P<timestamp>\\S+) (?P<stream>\\S+) (?P<flags>\\S+) )?(?P<message>.*)$` | line_format `{{.message}}` | json",
1497+
"skipUrlSync": false,
1498+
"type": "constant",
1499+
"current": {
1500+
"value": "regexp `^(?:(?P<timestamp>\\S+) (?P<stream>\\S+) (?P<flags>\\S+) )?(?P<message>.*)$` | line_format `{{.message}}` | json",
1501+
"text": "regexp `^(?:(?P<timestamp>\\S+) (?P<stream>\\S+) (?P<flags>\\S+) )?(?P<message>.*)$` | line_format `{{.message}}` | json",
1502+
"selected": false
1503+
},
1504+
"options": [
1505+
{
1506+
"value": "regexp `^(?:(?P<timestamp>\\S+) (?P<stream>\\S+) (?P<flags>\\S+) )?(?P<message>.*)$` | line_format `{{.message}}` | json",
1507+
"text": "regexp `^(?:(?P<timestamp>\\S+) (?P<stream>\\S+) (?P<flags>\\S+) )?(?P<message>.*)$` | line_format `{{.message}}` | json",
1508+
"selected": false
1509+
}
1510+
]
14911511
}
14921512
]
14931513
},
@@ -1499,6 +1519,6 @@
14991519
"timezone": "browser",
15001520
"title": "Cilium Flows - Hubble Observer",
15011521
"uid": "ozk-cilium-flows-hubble-observer",
1502-
"version": 28,
1522+
"version": 29,
15031523
"weekStart": ""
1504-
}
1524+
}

0 commit comments

Comments
 (0)