Skip to content

Commit

Permalink
NETOBSERV-1017: pods/services bandwidth (#523)
Browse files Browse the repository at this point in the history
Provide sample FlowMetrics files to get top pods/services bandwidth
The metrics can be queried with:

- Pods incoming: topk(10, sum(rate(netobserv_pod_incoming_bytes_total[1m])) by (DstK8S_Name, DstK8S_Namespace))
- Pods outgoing: topk(10, sum(rate(netobserv_pod_outgoing_bytes_total[1m])) by (SrcK8S_Name, SrcK8S_Namespace))
- Services incoming: topk(10, sum(rate(netobserv_service_incoming_bytes_total[1m])) by (DstK8S_Name, DstK8S_Namespace))
  • Loading branch information
jotak authored Jan 18, 2024
1 parent 34965b4 commit da4bdd3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
13 changes: 13 additions & 0 deletions config/samples/flowmetrics/pods_incoming_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: flows.netobserv.io/v1alpha1
kind: FlowMetric
metadata:
name: flowmetric-pod-incoming
spec:
metricName: pod_incoming_bytes_total
type: Counter
valueField: Bytes
direction: Ingress
labels: [DstK8S_Name,DstK8S_Namespace,DstK8S_OwnerName,DstK8S_OwnerType,DstK8S_HostName]
filters:
- field: DstK8S_Type
value: Pod
13 changes: 13 additions & 0 deletions config/samples/flowmetrics/pods_outgoing_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: flows.netobserv.io/v1alpha1
kind: FlowMetric
metadata:
name: flowmetric-pod-outgoing
spec:
metricName: pod_outgoing_bytes_total
type: Counter
valueField: Bytes
direction: Egress
labels: [SrcK8S_Name,SrcK8S_Namespace,SrcK8S_OwnerName,SrcK8S_OwnerType,SrcK8S_HostName]
filters:
- field: SrcK8S_Type
value: Pod
14 changes: 14 additions & 0 deletions config/samples/flowmetrics/services_incoming_bytes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: flows.netobserv.io/v1alpha1
kind: FlowMetric
metadata:
name: flowmetric-service-incoming
spec:
metricName: service_incoming_bytes_total
type: Counter
valueField: Bytes
# Note that we need to look from the sender point of view to get traffic to services, hence Egress here
direction: Egress
labels: [DstK8S_Name,DstK8S_Namespace,DstK8S_OwnerName,DstK8S_OwnerType,DstK8S_HostName]
filters:
- field: DstK8S_Type
value: Service

0 comments on commit da4bdd3

Please sign in to comment.