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
(More examples available [here](https://github.com/netobserv/network-observability-operator/tree/main/config/samples/flowmetrics), including for external traffic latency)
90
90
91
-
These metrics leverage the absence of Subnet Labels in order to track external traffic. In Prometheus, you can query them with `promQL` such as:
91
+
These metrics leverage the absence of Subnet Labels in order to track external traffic. They also consider Subnet Labels prefixed with `EXT:` as external traffic. If you look at their definition, you'll see these rules expressed as that:
92
+
93
+
```yaml
94
+
filters:
95
+
- field: DstSubnetLabel
96
+
matchType: Absence
97
+
- field: DstSubnetLabel
98
+
matchType: MatchRegex
99
+
value: "^EXT:.*"
100
+
```
101
+
102
+
{#admon title="Info"}
103
+
In `FlowMetrics`, when there are several filters for the same key, those filters are OR'ed, ie. the match is satisfied if one at least is satisfied. Filters on different keys are AND'ed.
104
+
{/}
105
+
106
+
In Prometheus, you can query them with the following `promQL`:
92
107
93
108
```
94
109
topk(10, sum(rate(netobserv_cluster_external_egress_bytes_total{ SrcK8S_Namespace!="" }[2m])) by (SrcK8S_Namespace, SrcK8S_OwnerName))
@@ -154,52 +169,17 @@ We can inject them in our `subnetLabels` config:
154
169
- 3.5.224.0/22
155
170
- 13.36.84.48/28
156
171
- 13.36.84.64/28
157
-
name: EXT-AWS_S3_eu-west-3
172
+
name: EXT:AWS_S3_eu-west-3
158
173
```
159
174
160
-
It is a good practice to use a common prefix for all labels on external traffic, such as "EXT-" here, in order to distinguish external and internal subnet labels.
175
+
It is a good practice to use a common prefix for all labels on external traffic, such as "EXT:" here, in order to distinguish external and internal subnet labels. As we've seen before, this prefix is used in the sample metrics definitions for external traffic.
161
176
162
177
You can go ahead and mark all the known external traffic in a similar way: databases, VMs, web services, etc.
163
178
164
179
{#admon title="Info"}
165
180
Granted, in the current release of NetObserv, going through every Subnet Labels configuration might be cumbersome. `FlowCollector` is a centralized API, typically managed by cluster admins, whereas knowing the various subnet dependencies might be more in the perimeter of application teams. We are currently working on a new feature that allows delegating that kind of configuration, so stay tuned!
166
181
{/}
167
182
168
-
Once we've created that label, we need to update our `FlowMetric` examples that filter on subnet label absence.
so that traffic to our new label is considered as external. We can also add `DstSubnetLabel` to the list of labels in the generated metric, for a finer granularity of the destinations.
196
-
197
-
A similar change can be done for the ingress traffic.
198
-
199
-
{#admon title="Info"}
200
-
In `FlowMetrics`, when there are several filters for the same key, those filters are OR'ed, ie. the match is satisfied if one at least is satisfied. Filters on different keys are AND'ed.
201
-
{/}
202
-
203
183
With this setup, we are finally able to understand where the traffic is flowing to:
204
184
205
185

0 commit comments