Skip to content

Commit e886fe9

Browse files
committed
Distinguish type/docType; add missing cardinality
1 parent fe6f592 commit e886fe9

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

controllers/consoleplugin/config/static-frontend-config.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,20 +1265,23 @@ fields:
12651265
- 2: Inner (with the same source and destination node)
12661266
- name: IfDirections
12671267
type: number
1268+
docType: number[]
12681269
description: |
12691270
Flow directions from the network interface observation point. Can be one of: +
12701271
- 0: Ingress (interface incoming traffic) +
12711272
- 1: Egress (interface outgoing traffic)
12721273
- name: Interfaces
12731274
type: string
1275+
docType: string[]
12741276
description: Network interfaces
12751277
- name: Flags
12761278
type: string
1279+
docType: string[]
12771280
description: |
1278-
Logical OR combination of unique TCP flags comprised in the flow, as per RFC-9293, with additional custom flags to represent the following per-packet combinations: +
1279-
- SYN+ACK (0x100) +
1280-
- FIN+ACK (0x200) +
1281-
- RST+ACK (0x400)
1281+
List of TCP flags comprised in the flow, as per RFC-9293, with additional custom flags to represent the following per-packet combinations: +
1282+
- SYN+ACK +
1283+
- FIN+ACK +
1284+
- RST+ACK
12821285
- name: Bytes
12831286
type: number
12841287
description: Number of bytes
@@ -1322,7 +1325,15 @@ fields:
13221325
description: TCP Smoothed Round Trip Time (SRTT), in nanoseconds
13231326
- name: NetworkEvents
13241327
type: string
1325-
description: Network events flow monitoring
1328+
docType: object[]
1329+
description: |
1330+
Network events, such as network policy actions, composed of nested fields: +
1331+
- Feature (such as "acl" for network policies) +
1332+
- Type (such as an "AdminNetworkPolicy") +
1333+
- Namespace (namespace where the event applies, if any) +
1334+
- Name (name of the resource that triggered the event) +
1335+
- Action (such as "allow" or "drop") +
1336+
- Direction (Ingress or Egress)
13261337
- name: ZoneId
13271338
type: number
13281339
description: packet translation zone id

hack/asciidoc-flows-gen.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@ nbfields=$(yq '.fields | length' $FE_SOURCE)
1919
lokiLabels=$(cat $LOKI_LABEL_SOURCE)
2020
cardinalityMap=$(cat $CARDINALITY_SOURCE)
2121
otelMap=$(cat $OTEL_SOURCE)
22+
errors=""
2223

2324
for i in $(seq 0 $(( $nbfields-1 )) ); do
2425
frontEntry=$(yq ".fields | sort_by(.name) | .[$i]" $FE_SOURCE)
2526
name=$(printf "$frontEntry" | yq ".name")
26-
type=$(printf "$frontEntry" | yq ".type")
27+
type=$(printf "$frontEntry" | yq ".docType")
28+
if [[ "$type" == "null" ]]; then
29+
type=$(printf "$frontEntry" | yq ".type")
30+
fi
2731
desc=$(printf "$frontEntry" | yq ".description")
2832
filter=$(printf "$frontEntry" | yq ".filter")
2933
if [[ "$filter" == "null" ]]; then
@@ -44,8 +48,7 @@ for i in $(seq 0 $(( $nbfields-1 )) ); do
4448
fi
4549
cardWarn=$(printf "$cardinalityMap" | jq -r ".$name")
4650
if [[ "$cardWarn" == "null" ]]; then
47-
echo "missing cardinality for field $name"
48-
exit 1
51+
errors="$errors\nmissing cardinality for field $name"
4952
fi
5053
otel=$(printf "$otelMap" | jq -r ".$name")
5154
if [[ "$otel" == "null" ]]; then
@@ -60,4 +63,9 @@ for i in $(seq 0 $(( $nbfields-1 )) ); do
6063
echo -e "| $otel" >> $ADOC
6164
done
6265

66+
if [[ $errors != "" ]]; then
67+
echo -e $errors
68+
exit 1
69+
fi
70+
6371
echo -e '|===' >> $ADOC

pkg/helper/cardinality/cardinality.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,20 @@
5050
"DnsErrno": "fine",
5151
"TimeFlowRttNs": "avoid",
5252
"NetworkEvents": "avoid",
53+
"NetworkEvents>Feature": "fine",
5354
"NetworkEvents>Type": "fine",
5455
"NetworkEvents>Namespace": "fine",
5556
"NetworkEvents>Name": "fine",
5657
"NetworkEvents>Action": "fine",
5758
"NetworkEvents>Direction": "fine",
5859
"K8S_ClusterName": "fine",
60+
"Sampling": "fine",
61+
"ZoneId": "avoid",
62+
"XlatSrcPort": "careful",
63+
"XlatSrcAddr": "avoid",
64+
"XlatIcmpId": "avoid",
65+
"XlatDstPort": "careful",
66+
"XlatDstAddr": "avoid",
5967
"_RecordType": "fine",
6068
"_HashId": "avoid"
6169
}

0 commit comments

Comments
 (0)