Skip to content

Commit

Permalink
NETOBSERV-1904 add configs for UDNs (#909)
Browse files Browse the repository at this point in the history
* add configs for UDNs

* fix tests

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

Co-authored-by: Joel Takvorian <jtakvori@redhat.com>

---------

Co-authored-by: Joel Takvorian <jtakvori@redhat.com>
  • Loading branch information
jpinsonneau and jotak authored Jan 20, 2025
1 parent 3108dfe commit c559a13
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
40 changes: 39 additions & 1 deletion controllers/consoleplugin/config/static-frontend-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ columns:
field: Interfaces
default: false
width: 15
- id: UDN
name: User Defined Network
tooltip: The user defined network identifier.
field: UdnId
filter: udn
default: false
width: 15
- id: Bytes
name: Bytes
tooltip: The total aggregated number of bytes.
Expand Down Expand Up @@ -944,6 +951,10 @@ filters:
component: autocomplete
placeholder: 'E.g: Ingress, Egress'
hint: Specify the direction of the Flow observed at the network interface observation point.
- id: udn
name: User Defined Network
component: autocomplete
hint: Specify a user defined network name.
- id: id
name: Conversation Id
component: text
Expand Down Expand Up @@ -1031,6 +1042,14 @@ scopes:
feature: multiCluster
filter: cluster_name
stepInto: zone
- id: udn
name: UDN
shortName: UDN
description: User Defined Network
labels:
- UdnId
filter: udn
stepInto: namespace
- id: zone
name: Zone
shortName: AZ
Expand All @@ -1053,9 +1072,12 @@ scopes:
- SrcK8S_HostName
- DstK8S_HostName
groups:
- clusters
- udns
- zones
- clusters
- clusters+zones
- clusters+udns
- udns+zones
filters:
- src_host_name
- dst_host_name
Expand All @@ -1074,6 +1096,9 @@ scopes:
- zones
- zones+hosts
- hosts
- udns
- udns+zones
- udns+hosts
filters:
- src_namespace
- dst_namespace
Expand All @@ -1100,6 +1125,10 @@ scopes:
- hosts
- hosts+namespaces
- namespaces
- udns
- udns+zones
- udns+hosts
- udns+namespaces
filters:
- src_owner_name
- dst_owner_name
Expand Down Expand Up @@ -1139,6 +1168,11 @@ scopes:
- namespaces
- namespaces+owners
- owners
- udns
- udns+zones
- udns+hosts
- udns+namespaces
- udns+owners
filters:
- src_resource
- dst_resource
Expand Down Expand Up @@ -1331,6 +1365,10 @@ fields:
- name: K8S_ClusterName
type: string
description: Cluster name or identifier
- name: UdnId
type: string
description: User Defined Network
lokiLabel: true
- name: _RecordType
type: string
description: "Type of record: 'flowLog' for regular flow logs, or 'newConnection', 'heartbeat', 'endConnection' for conversation tracking"
Expand Down
2 changes: 2 additions & 0 deletions controllers/flp/flp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ func TestConfigMapShouldDeserializeAsJSONWithLokiManual(t *testing.T) {
"DstK8S_Type",
"K8S_FlowLayer",
"FlowDirection",
"UdnId",
"_RecordType",
}, lokiCfg.Labels)
assert.Equal(`{app="netobserv-flowcollector"}`, fmt.Sprintf("%v", lokiCfg.StaticLabels))
Expand Down Expand Up @@ -711,6 +712,7 @@ func TestConfigMapShouldDeserializeAsJSONWithLokiStack(t *testing.T) {
"DstK8S_Type",
"K8S_FlowLayer",
"FlowDirection",
"UdnId",
"_RecordType",
}, lokiCfg.Labels)
assert.Equal(`{app="netobserv-flowcollector"}`, fmt.Sprintf("%v", lokiCfg.StaticLabels))
Expand Down
2 changes: 2 additions & 0 deletions pkg/helper/loki/labels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestDefaultLokiLabels(t *testing.T) {
"DstK8S_Type",
"K8S_FlowLayer",
"FlowDirection",
"UdnId",
})
}

Expand All @@ -40,6 +41,7 @@ func TestAllLokiLabels(t *testing.T) {
"DstK8S_Type",
"K8S_FlowLayer",
"FlowDirection",
"UdnId",
"_RecordType",
"K8S_ClusterName",
"SrcK8S_Zone",
Expand Down
3 changes: 2 additions & 1 deletion pkg/helper/loki/loki-labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"DstK8S_OwnerName",
"DstK8S_Type",
"K8S_FlowLayer",
"FlowDirection"
"FlowDirection",
"UdnId"
],
"conntrack": [
"_RecordType"
Expand Down

0 comments on commit c559a13

Please sign in to comment.