You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NETOBSERV-1935: enable metrics from list/nested fields (#863)
* NETOBSERV-1935: enable metrics from list/nested fields
* use merge flp deps
* Fix webhook validation for nested fields
* Add netpol events as predefined metrics
3 new metrics:
- node_network_policy_events_total
- namespace_network_policy_events_total (enabled by default)
- workload_network_policy_events_total
And their related charts
* NetEvents: use filter name consistent with column
Copy file name to clipboardExpand all lines: apis/flowmetrics/v1alpha1/flowmetric_types.go
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,11 @@ type FlowMetricSpec struct {
93
93
// +optional
94
94
Labels []string`json:"labels"`
95
95
96
+
// `flatten` is a list of list-type fields that must be flattened, such as Interfaces and NetworkEvents. Flattened fields generate one metric per item in that field.
97
+
// For instance, when flattening `Interfaces` on a bytes counter, a flow having Interfaces [br-ex, ens5] increases one counter for `br-ex` and another for `ens5`.
98
+
// +optional
99
+
Flatten []string`json:"flatten"`
100
+
96
101
// Set the `remap` property to use different names for the generated metric labels than the flow fields. Use the origin flow fields as keys, and the desired label names as values.
Copy file name to clipboardExpand all lines: bundle/manifests/flows.netobserv.io_flowmetrics.yaml
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -196,6 +196,13 @@ spec:
196
196
- matchType
197
197
type: object
198
198
type: array
199
+
flatten:
200
+
description: |-
201
+
`flatten` is a list of list-type fields that must be flattened, such as Interfaces and NetworkEvents. Flattened fields generate one metric per item in that field.
202
+
For instance, when flattening `Interfaces` on a bytes counter, a flow having Interfaces [br-ex, ens5] increases one counter for `br-ex` and another for `ens5`.
203
+
items:
204
+
type: string
205
+
type: array
199
206
labels:
200
207
description: |-
201
208
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions.
Copy file name to clipboardExpand all lines: config/crd/bases/flows.netobserv.io_flowmetrics.yaml
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,13 @@ spec:
186
186
- matchType
187
187
type: object
188
188
type: array
189
+
flatten:
190
+
description: |-
191
+
`flatten` is a list of list-type fields that must be flattened, such as Interfaces and NetworkEvents. Flattened fields generate one metric per item in that field.
192
+
For instance, when flattening `Interfaces` on a bytes counter, a flow having Interfaces [br-ex, ens5] increases one counter for `br-ex` and another for `ens5`.
193
+
items:
194
+
type: string
195
+
type: array
189
196
labels:
190
197
description: |-
191
198
`labels` is a list of fields that should be used as Prometheus labels, also known as dimensions.
0 commit comments