Skip to content

Commit d649199

Browse files
authored
Merge pull request #36 from KalmanMeth/src-dst-subnet-aggregate
added network metric definitions for src and dest subnet aggregates
2 parents c8323a5 + 0bbd83c commit d649199

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
@@ -31,6 +31,22 @@ dashboard.new(
3131
h: 20,
3232
}
3333
)
34+
.addPanel(
35+
graphPanel.new(
36+
datasource='prometheus',
37+
title="Bandwidth per src and destination subnet",
38+
)
39+
.addTarget(
40+
prometheus.target(
41+
expr='topk(10,rate(fl2m_bandwidth_per_source_destination_subnet[1m]))',
42+
)
43+
), gridPos={
44+
x: 0,
45+
y: 0,
46+
w: 25,
47+
h: 20,
48+
}
49+
)
3450
.addPanel(
3551
graphPanel.new(
3652
datasource='prometheus',
@@ -127,6 +143,22 @@ dashboard.new(
127143
h: 20,
128144
}
129145
)
146+
.addPanel(
147+
graphPanel.new(
148+
datasource='prometheus',
149+
title="Connections rate of src / destination subnet occurences",
150+
)
151+
.addTarget(
152+
prometheus.target(
153+
expr='topk(10,rate(fl2m_count_per_source_destination_subnet[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
@@ -13,6 +13,13 @@ pipeline:
1313
- by
1414
- aggregate
1515
buckets: []
16+
- name: bandwidth_per_source_destination_subnet
17+
type: gauge
18+
valuekey: bandwidth_source_destination_subnet_value
19+
labels:
20+
- by
21+
- aggregate
22+
buckets: []
1623
- name: bandwidth_per_source_subnet
1724
type: gauge
1825
valuekey: bandwidth_source_subnet_value
@@ -55,6 +62,13 @@ pipeline:
5562
- by
5663
- aggregate
5764
buckets: []
65+
- name: count_per_source_destination_subnet
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
@@ -107,6 +121,12 @@ pipeline:
107121
- service
108122
operation: sum
109123
recordkey: bytes
124+
- name: bandwidth_source_destination_subnet
125+
by:
126+
- dstSubnet24
127+
- srcSubnet24
128+
operation: sum
129+
recordkey: bytes
110130
- name: bandwidth_source_subnet
111131
by:
112132
- srcSubnet
@@ -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
@@ -200,6 +226,14 @@ pipeline:
200226
output: service
201227
type: add_service
202228
parameters: proto
229+
- input: dstIP
230+
output: dstSubnet24
231+
type: add_subnet
232+
parameters: /24
233+
- input: srcIP
234+
output: srcSubnet24
235+
type: add_subnet
236+
parameters: /24
203237
- input: srcIP
204238
output: srcSubnet
205239
type: add_subnet
@@ -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
@@ -24,6 +24,18 @@ and the transformation to generate the exported metric.
2424
|||
2525

2626

27+
### bandwidth per src dest subnet
28+
| **Description** | This metric observes the network bandwidth per source and destination subnets |
29+
|:---|:---|
30+
| **Details** | Sum bandwidth bytes for all traffic per source / destination subnet pair |
31+
| **Usage** | Evaluate network usage breakdown per source / destination subnet pair |
32+
| **Labels** | bandwidth, graph, rate, subnet |
33+
| **Operation** | aggregate by `dstSubnet24, srcSubnet24` and `sum` field `bytes` |
34+
| **Exposed as** | `fl2m_bandwidth_per_source_destination_subnet` of type `gauge` |
35+
| **Visualized as** | "Bandwidth per src and destination subnet" on dashboard `details` |
36+
|||
37+
38+
2739
### bandwidth per src subnet
2840
| **Description** | This metric observes the network bandwidth per source subnet |
2941
|:---|:---|
@@ -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_count_per_source_destination_subnet` of type `gauge` |
119+
| **Visualized as** | "Connections rate 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: bandwidth_per_source_destination_subnet
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_bandwidth_per_source_destination_subnet[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: count_per_source_destination_subnet
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_count_per_source_destination_subnet[1m]))'
44+
type: graphPanel
45+
dashboard: details
46+
title:
47+
Connections rate of src / destination subnet occurences

0 commit comments

Comments
 (0)