Skip to content

Commit

Permalink
NodeDirection / IfDirection
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinsonneau committed Mar 12, 2024
1 parent 19bcb45 commit 1a21127
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 37 deletions.
52 changes: 32 additions & 20 deletions controllers/consoleplugin/config/static-frontend-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,23 +381,30 @@ columns:
default: false
width: 10
- id: FlowDirection
name: Direction
tooltip: The direction of the flow observed at the Node observation point.
name: Node Direction
tooltip: The interpreted direction of the flow observed at the Node observation point.
field: FlowDirection
filter: direction
filter: node_direction
default: false
width: 10
- id: Interface
name: Interface
tooltip: The network interface of the Flow.
field: Interface
filter: interface
- id: Interfaces
name: Interfaces
tooltip: The network interfaces of the Flow.
field: Interfaces
filter: interfaces
default: false
width: 10
- id: IfDirections
name: Interface Directions
tooltip: The directions of the Flow observed at the network interface observation point.
field: IfDirections
filter: ifdirections
default: false
width: 10
- id: FlowDirInts
name: Interfaces and Directions
tooltip: Pairs of network interface and direction of the Flow observed at the Node observation point.
field: FlowDirection
tooltip: Pairs of network interface and direction of the Flow observed at the network interface observation point.
field: Interfaces
default: false
width: 15
- id: Bytes
Expand Down Expand Up @@ -757,21 +764,26 @@ filters:
name: ICMP code
component: number
hint: Specify an ICMP code value as integer number.
- id: direction
name: Direction
- id: node_direction
name: Node Direction
component: autocomplete
placeholder: 'E.g: Ingress, Egress, Inner'
hint: Specify the direction of the Flow observed at the Node observation point.
hint: Specify the interpreted direction of the Flow observed at the Node observation point.
- id: flow_layer
name: Flow layer
component: text
placeholder: 'Either infra or app'
hint: Specify the layer of Flow.
- id: interface
name: Network interface
- id: interfaces
name: Network interfaces
component: text
placeholder: 'E.g: br-ex, ovn-k8s-mp0'
hint: Specify a network interface.
- id: ifdirections
name: Interface Directions
component: autocomplete
placeholder: 'E.g: Ingress, Egress'
hint: Specify the direction of the Flow observed at the network interface observation point.
- id: id
name: Conversation Id
component: text
Expand Down Expand Up @@ -930,20 +942,20 @@ fields:
- name: FlowDirection
type: number
description: |
Flow direction from the node observation point. Can be one of: +
Flow interpreted direction from the node observation point. Can be one of: +
- 0: Ingress (incoming traffic, from the node observation point) +
- 1: Egress (outgoing traffic, from the node observation point) +
- 2: Inner (with the same source and destination node)
lokiLabel: true
- name: IfDirection
- name: IfDirections
type: number
description: |
Flow direction from the network interface observation point. Can be one of: +
Flow directions from the network interface observation point. Can be one of: +
- 0: Ingress (interface incoming traffic) +
- 1: Egress (interface outgoing traffic)
- name: Interface
- name: Interfaces
type: string
description: Network interface
description: Network interfaces
- name: Flags
type: number
description: |
Expand Down
3 changes: 1 addition & 2 deletions controllers/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ const (
LokiCRReader = "netobserv-reader"
)

var LokiIndexFields = []string{"SrcK8S_Namespace", "SrcK8S_OwnerName", "SrcK8S_Type", "DstK8S_Namespace", "DstK8S_OwnerName", "DstK8S_Type", "K8S_FlowLayer"}
var LokiIndexFields = []string{"SrcK8S_Namespace", "SrcK8S_OwnerName", "SrcK8S_Type", "DstK8S_Namespace", "DstK8S_OwnerName", "DstK8S_Type", "K8S_FlowLayer", "FlowDirection"}
var LokiConnectionIndexFields = []string{"_RecordType"}
var LokiDeduperMarkIndexFields = []string{"FlowDirection"}
var LokiZoneIndexFields = []string{"SrcK8S_Zone", "DstK8S_Zone"}
var FlowCollectorName = types.NamespacedName{Name: "cluster"}
var EnvNoHTTP2 = corev1.EnvVar{
Expand Down
1 change: 0 additions & 1 deletion controllers/flp/flp_pipeline_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ func (b *PipelineBuilder) AddProcessorStages() error {
SrcHostField: "SrcK8S_HostIP",
DstHostField: "DstK8S_HostIP",
FlowDirectionField: "FlowDirection",
IfDirectionField: "IfDirection",
},
})

Expand Down
2 changes: 1 addition & 1 deletion controllers/flp/flp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ func TestConfigMapShouldDeserializeAsJSONWithLokiStack(t *testing.T) {
"DstK8S_OwnerName",
"DstK8S_Type",
"K8S_FlowLayer",
"_RecordType",
"FlowDirection",
"_RecordType",
}, lokiCfg.Labels)
assert.Equal(`{app="netobserv-flowcollector"}`, fmt.Sprintf("%v", lokiCfg.StaticLabels))

Expand Down
13 changes: 0 additions & 13 deletions pkg/loki/labels.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package loki

import (
"strconv"

flowslatest "github.com/netobserv/network-observability-operator/apis/flowcollector/v1beta2"
"github.com/netobserv/network-observability-operator/controllers/constants"
"github.com/netobserv/network-observability-operator/controllers/ebpf"
"github.com/netobserv/network-observability-operator/pkg/helper"
)

Expand All @@ -24,15 +21,5 @@ func GetLokiLabels(desired *flowslatest.FlowCollectorSpec) []string {
indexFields = append(indexFields, constants.LokiZoneIndexFields...)
}

dedupJustMark, _ := strconv.ParseBool(ebpf.DedupeJustMarkDefault)
if desired.Agent.EBPF.Advanced != nil {
if v, ok := desired.Agent.EBPF.Advanced.Env[ebpf.EnvDedupeJustMark]; ok {
dedupJustMark, _ = strconv.ParseBool(v)
}
}
if dedupJustMark {
indexFields = append(indexFields, constants.LokiDeduperMarkIndexFields...)
}

return indexFields
}

0 comments on commit 1a21127

Please sign in to comment.