Skip to content

Commit 029a2aa

Browse files
committed
added network metric definitions for src and dest subnet aggregates
1 parent c8323a5 commit 029a2aa

File tree

5 files changed

+193
-0
lines changed

5 files changed

+193
-0
lines changed

contrib/dashboards/jsonnet/dashboard_details.jsonnet

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ dashboard.new(
1515
time_from="now-15m",
1616
tags=['fl2m','grafana','dashboard','details'],
1717
)
18+
.addPanel(
19+
graphPanel.new(
20+
datasource='prometheus',
21+
title="Bandwidth per src and destination subnet",
22+
)
23+
.addTarget(
24+
prometheus.target(
25+
expr='topk(10,rate(fl2m_bandwidthPerSourceDestinationSubnet[1m]))',
26+
)
27+
), gridPos={
28+
x: 0,
29+
y: 0,
30+
w: 25,
31+
h: 20,
32+
}
33+
)
1834
.addPanel(
1935
graphPanel.new(
2036
datasource='prometheus',
@@ -127,6 +143,22 @@ dashboard.new(
127143
h: 20,
128144
}
129145
)
146+
.addPanel(
147+
graphPanel.new(
148+
datasource='prometheus',
149+
title="Count of src / destination subnet occurences",
150+
)
151+
.addTarget(
152+
prometheus.target(
153+
expr='topk(10,rate(fl2m_countPerSourceDestinationSubnet[1m]))',
154+
)
155+
), gridPos={
156+
x: 0,
157+
y: 0,
158+
w: 25,
159+
h: 20,
160+
}
161+
)
130162
.addPanel(
131163
graphPanel.new(
132164
datasource='prometheus',

contrib/kubernetes/flowlogs2metrics.conf.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ pipeline:
66
encode:
77
prom:
88
metrics:
9+
- name: bandwidthPerSourceDestinationSubnet
10+
type: gauge
11+
valuekey: bandwidth_source_destination_subnet_value
12+
labels:
13+
- by
14+
- aggregate
15+
buckets: []
916
- name: bandwidth_per_network_service
1017
type: gauge
1118
valuekey: bandwidth_network_service_value
@@ -55,6 +62,13 @@ pipeline:
5562
- by
5663
- aggregate
5764
buckets: []
65+
- name: countPerSourceDestinationSubnet
66+
type: gauge
67+
valuekey: count_source_destination_subnet_value
68+
labels:
69+
- by
70+
- aggregate
71+
buckets: []
5872
- name: egress_per_destination_subnet
5973
type: gauge
6074
valuekey: bandwidth_destination_subnet_value
@@ -102,6 +116,12 @@ pipeline:
102116
type: prom
103117
extract:
104118
aggregates:
119+
- name: bandwidth_source_destination_subnet
120+
by:
121+
- dstSubnet24
122+
- srcSubnet24
123+
operation: sum
124+
recordkey: bytes
105125
- name: bandwidth_network_service
106126
by:
107127
- service
@@ -137,6 +157,12 @@ pipeline:
137157
- srcAS
138158
operation: count
139159
recordkey: ""
160+
- name: count_source_destination_subnet
161+
by:
162+
- dstSubnet24
163+
- srcSubnet24
164+
operation: count
165+
recordkey: ""
140166
- name: bandwidth_destination_subnet
141167
by:
142168
- dstSubnet
@@ -196,6 +222,14 @@ pipeline:
196222
type: generic
197223
- network:
198224
rules:
225+
- input: dstIP
226+
output: dstSubnet24
227+
type: add_subnet
228+
parameters: /24
229+
- input: srcIP
230+
output: srcSubnet24
231+
type: add_subnet
232+
parameters: /24
199233
- input: dstPort
200234
output: service
201235
type: add_service
@@ -212,6 +246,14 @@ pipeline:
212246
output: srcSubnet
213247
type: add_subnet
214248
parameters: /16
249+
- input: dstIP
250+
output: dstSubnet24
251+
type: add_subnet
252+
parameters: /24
253+
- input: srcIP
254+
output: srcSubnet24
255+
type: add_subnet
256+
parameters: /24
215257
- input: dstIP
216258
output: dstSubnet
217259
type: add_subnet

docs/metrics.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ and the transformation to generate the exported metric.
1212

1313

1414

15+
### bandwdth per src dest subnet
16+
| **Description** | This metric observes the network bandwidth per source and destination subnets |
17+
|:---|:---|
18+
| **Details** | Sum bandwidth bytes for all traffic per source / destination subnet pair |
19+
| **Usage** | Evaluate network usage breakdown per source / destination subnet pair |
20+
| **Labels** | bandwidth, graph, rate, subnet |
21+
| **Operation** | aggregate by `dstSubnet24, srcSubnet24` and `sum` field `bytes` |
22+
| **Exposed as** | `fl2m_bandwidthPerSourceDestinationSubnet` of type `gauge` |
23+
| **Visualized as** | "Bandwidth per src and destination subnet" on dashboard `details` |
24+
|||
25+
26+
1527
### bandwidth per network service
1628
| **Description** | This metric observes the network bandwidth per network service |
1729
|:---|:---|
@@ -96,6 +108,18 @@ and the transformation to generate the exported metric.
96108
|||
97109

98110

111+
### count per src dest subnet
112+
| **Description** | This metric counts the number of distinct source / destination subnet pairs |
113+
|:---|:---|
114+
| **Details** | Count the number of distinct source / destination subnet pairs |
115+
| **Usage** | Evaluate network usage breakdown per source / destination subnet pair |
116+
| **Labels** | count, graph, rate, subnet |
117+
| **Operation** | aggregate by `dstSubnet24, srcSubnet24` and `count` |
118+
| **Exposed as** | `fl2m_countPerSourceDestinationSubnet` of type `gauge` |
119+
| **Visualized as** | "Count of src / destination subnet occurences" on dashboard `details` |
120+
|||
121+
122+
99123
### egress bandwidth per dest subnet
100124
| **Description** | This metric observes the network bandwidth per destination subnet |
101125
|:---|:---|
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#fl2m_confgen
2+
description:
3+
This metric observes the network bandwidth per source and destination subnets
4+
details:
5+
Sum bandwidth bytes for all traffic per source / destination subnet pair
6+
usage:
7+
Evaluate network usage breakdown per source / destination subnet pair
8+
labels:
9+
- bandwidth
10+
- graph
11+
- rate
12+
- subnet
13+
transform:
14+
rules:
15+
- input: dstIP
16+
output: dstSubnet24
17+
type: add_subnet
18+
parameters: /24
19+
- input: srcIP
20+
output: srcSubnet24
21+
type: add_subnet
22+
parameters: /24
23+
extract:
24+
aggregates:
25+
- name: bandwidth_source_destination_subnet
26+
by:
27+
- dstSubnet24
28+
- srcSubnet24
29+
operation: sum
30+
RecordKey: bytes
31+
encode:
32+
type: prom
33+
prom:
34+
metrics:
35+
- name: bandwidthPerSourceDestinationSubnet
36+
type: gauge
37+
valuekey: bandwidth_source_destination_subnet_value
38+
labels:
39+
- by
40+
- aggregate
41+
visualization:
42+
type: grafana
43+
grafana:
44+
- expr: 'topk(10,rate(fl2m_bandwidthPerSourceDestinationSubnet[1m]))'
45+
type: graphPanel
46+
dashboard: details
47+
title:
48+
Bandwidth per src and destination subnet
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#fl2m_confgen
2+
description:
3+
This metric counts the number of distinct source / destination subnet pairs
4+
details:
5+
Count the number of distinct source / destination subnet pairs
6+
usage:
7+
Evaluate network usage breakdown per source / destination subnet pair
8+
labels:
9+
- count
10+
- graph
11+
- rate
12+
- subnet
13+
transform:
14+
rules:
15+
- input: dstIP
16+
output: dstSubnet24
17+
type: add_subnet
18+
parameters: /24
19+
- input: srcIP
20+
output: srcSubnet24
21+
type: add_subnet
22+
parameters: /24
23+
extract:
24+
aggregates:
25+
- name: count_source_destination_subnet
26+
by:
27+
- dstSubnet24
28+
- srcSubnet24
29+
operation: count
30+
encode:
31+
type: prom
32+
prom:
33+
metrics:
34+
- name: countPerSourceDestinationSubnet
35+
type: gauge
36+
valuekey: count_source_destination_subnet_value
37+
labels:
38+
- by
39+
- aggregate
40+
visualization:
41+
type: grafana
42+
grafana:
43+
- expr: 'topk(10,rate(fl2m_countPerSourceDestinationSubnet[1m]))'
44+
type: graphPanel
45+
dashboard: details
46+
title:
47+
Count of src / destination subnet occurences

0 commit comments

Comments
 (0)