Skip to content

Commit

Permalink
NETOBSERV-1959: Remove hardcoded columns rendering + other enhancemen…
Browse files Browse the repository at this point in the history
…ts (#633)

* NETOBSERV-1959: Remove hardcoded columns rendering + other enhancements

- Remove hardcoded columns
- Change some of the rendering scripted functions:
  - getConcatenatedValue -> concat now dedicated to just concatenate
    values
  - they can now accept litterals (e.g. concat(DstAddr,':',DstPort))
  - remove getSrcOrDstValue since there was also "[...]" for the same
    role
  - add new kubeObject func to show kind-name-namespace sort of things
- Improve performance by avoiding re-parsing everything for every rendered
  flow
  - there's probably more that we could do on that side
- Add unit tests

* preprocess a bit more of parsed functions

* address feedback

* Fix issues about visible fields in side panel

Previously, visible fields were determined out of several criteria
including:
- fields with calculated values were filtered out
- record with null value was filtered out (as opposed to undefined)

Also, "Common" columns was determined by having a calculated value (ie.
non-common columns were prohibited to use calculated)

This must change since columns can now have calculated and still must be
visible (e.g. SrcK8S_Name is a kubeObject calculated value)

- So, Common now is when calculated in the form of "[a,b]"
- Visible columns for side panel is now based on being tied to fields

* Use fieldValue func for filters

* NETOBSERV-1969: Fix IcmpType & IcmpCode

Those fields should be correctly displayed when ICMP data is present,
and not displayed (in side panel) when ICMP data is absent.

* format
  • Loading branch information
jotak authored Nov 19, 2024
1 parent 6bb4d91 commit 8fb9a44
Show file tree
Hide file tree
Showing 13 changed files with 464 additions and 386 deletions.
42 changes: 25 additions & 17 deletions config/sample-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ frontend:
docURL: http://kubernetes.io/docs/user-guide/identifiers#names
field: SrcK8S_Name
filter: src_name
calculated: kubeObject(SrcK8S_Type,SrcK8S_Namespace,SrcK8S_Name,0)
default: true
width: 15
- id: SrcK8S_Type
Expand All @@ -213,6 +214,7 @@ frontend:
docURL: https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
field: SrcK8S_OwnerName
filter: src_owner_name
calculated: kubeObject(SrcK8S_OwnerType,SrcK8S_Namespace,SrcK8S_OwnerName,0)
default: false
width: 15
- id: SrcK8S_OwnerType
Expand All @@ -236,6 +238,7 @@ frontend:
docURL: http://kubernetes.io/docs/user-guide/identifiers#namespaces
field: SrcK8S_Namespace
filter: src_namespace
calculated: kubeObject('Namespace','',SrcK8S_Namespace,0)
default: true
width: 15
- id: SrcAddr
Expand Down Expand Up @@ -277,24 +280,25 @@ frontend:
docURL: https://kubernetes.io/docs/concepts/architecture/nodes/
field: SrcK8S_HostName
filter: src_host_name
calculated: kubeObject('Node','',SrcK8S_HostName,0)
default: false
width: 15
- id: SrcK8S_Object
group: Source
name: Kubernetes Object
calculated: getConcatenatedValue(SrcAddr,SrcPort,SrcK8S_Type,SrcK8S_Namespace,SrcK8S_Name)
calculated: kubeObject(SrcK8S_Type,SrcK8S_Namespace,SrcK8S_Name,1) or concat(SrcAddr,':',SrcPort)
default: false
width: 15
- id: SrcK8S_OwnerObject
group: Source
name: Owner Kubernetes Object
calculated: getConcatenatedValue(SrcAddr,SrcPort,SrcK8S_OwnerType,SrcK8S_Namespace,SrcK8S_OwnerName)
calculated: kubeObject(SrcK8S_OwnerType,SrcK8S_Namespace,SrcK8S_OwnerName,1)
default: false
width: 15
- id: SrcAddrPort
group: Source
name: IP & Port
calculated: getConcatenatedValue(SrcAddr,SrcPort)
calculated: concat(SrcAddr,':',SrcPort)
default: false
width: 15
- id: SrcZone
Expand All @@ -312,6 +316,7 @@ frontend:
docURL: http://kubernetes.io/docs/user-guide/identifiers#names
field: DstK8S_Name
filter: dst_name
calculated: kubeObject(DstK8S_Type,DstK8S_Namespace,DstK8S_Name,0)
default: true
width: 15
- id: DstK8S_Type
Expand All @@ -333,6 +338,7 @@ frontend:
docURL: https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/
field: DstK8S_OwnerName
filter: dst_owner_name
calculated: kubeObject(DstK8S_OwnerType,DstK8S_Namespace,DstK8S_OwnerName,0)
default: false
width: 15
- id: DstK8S_OwnerType
Expand All @@ -356,6 +362,7 @@ frontend:
docURL: http://kubernetes.io/docs/user-guide/identifiers#namespaces
field: DstK8S_Namespace
filter: dst_namespace
calculated: kubeObject('Namespace','',DstK8S_Namespace,0)
default: true
width: 15
- id: DstAddr
Expand Down Expand Up @@ -397,24 +404,25 @@ frontend:
docURL: https://kubernetes.io/docs/concepts/architecture/nodes/
field: DstK8S_HostName
filter: dst_host_name
calculated: kubeObject('Node','',DstK8S_HostName,0)
default: false
width: 15
- id: DstK8S_Object
group: Destination
name: Kubernetes Object
calculated: getConcatenatedValue(DstAddr,DstPort,DstK8S_Type,DstK8S_Namespace,DstK8S_Name)
calculated: kubeObject(DstK8S_Type,DstK8S_Namespace,DstK8S_Name,1) or concat(DstAddr,':',DstPort)
default: false
width: 15
- id: DstK8S_OwnerObject
group: Destination
name: Owner Kubernetes Object
calculated: getConcatenatedValue(DstAddr,DstPort,DstK8S_OwnerType,DstK8S_Namespace,DstK8S_OwnerName)
calculated: kubeObject(DstK8S_OwnerType,DstK8S_Namespace,DstK8S_OwnerName,1)
default: false
width: 15
- id: DstAddrPort
group: Destination
name: IP & Port
calculated: getConcatenatedValue(DstAddr,DstPort)
calculated: concat(DstAddr,':',DstPort)
default: false
width: 15
- id: DstZone
Expand All @@ -427,52 +435,52 @@ frontend:
feature: zones
- id: K8S_Name
name: Names
calculated: getSrcOrDstValue(SrcK8S_Name,DstK8S_Name)
calculated: '[SrcK8S_Name,DstK8S_Name]'
default: false
width: 15
- id: K8S_Type
name: Kinds
calculated: getSrcOrDstValue(SrcK8S_Type,DstK8S_Type)
calculated: '[SrcK8S_Type,DstK8S_Type]'
default: false
width: 10
- id: K8S_OwnerName
name: Owners
calculated: getSrcOrDstValue(SrcK8S_OwnerName,DstK8S_OwnerName)
calculated: '[SrcK8S_OwnerName,DstK8S_OwnerName]'
default: false
width: 15
- id: K8S_OwnerType
name: Owner Kinds
calculated: getSrcOrDstValue(SrcK8S_OwnerType,DstK8S_OwnerType)
calculated: '[SrcK8S_OwnerType,DstK8S_OwnerType]'
default: false
width: 10
- id: K8S_Namespace
name: Namespaces
calculated: getSrcOrDstValue(SrcK8S_Namespace,DstK8S_Namespace)
calculated: '[SrcK8S_Namespace,DstK8S_Namespace]'
default: false
width: 15
- id: Addr
name: IP
calculated: getSrcOrDstValue(SrcAddr,DstAddr)
calculated: '[SrcAddr,DstAddr]'
default: false
width: 10
- id: Port
name: Ports
calculated: getSrcOrDstValue(SrcPort,DstPort)
calculated: '[SrcPort,DstPort]'
default: false
width: 10
- id: Mac
name: MAC
calculated: getSrcOrDstValue(SrcMac,DstMac)
calculated: '[SrcMac,DstMac]'
default: false
width: 10
- id: K8S_HostIP
name: Node IP
calculated: getSrcOrDstValue(SrcK8S_HostIP,DstK8S_HostIP)
calculated: '[SrcK8S_HostIP,DstK8S_HostIP]'
default: false
width: 10
- id: K8S_HostName
name: Node Name
calculated: getSrcOrDstValue(SrcK8S_HostName,DstK8S_HostName)
calculated: '[SrcK8S_HostName,DstK8S_HostName]'
default: false
width: 15
- id: K8S_Object
Expand Down Expand Up @@ -581,7 +589,7 @@ frontend:
- id: CollectionTime
name: Collection Time
tooltip: Reception time of the record by the collector.
calculated: multiply(TimeReceived,1000),
calculated: multiply(TimeReceived,1000)
field: TimeReceived
default: false
width: 15
Expand Down
Loading

0 comments on commit 8fb9a44

Please sign in to comment.