Skip to content

Commit

Permalink
added TopK to bandwidth_per_src_subnet (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
KalmanMeth committed Sep 14, 2022
1 parent 04c56ce commit ef4a155
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
30 changes: 21 additions & 9 deletions contrib/kubernetes/flowlogs-pipeline.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ pipeline:
follows: transform_network
- name: extract_aggregate
follows: extract_conntrack
- name: encode_prom
- name: extract_timebased
follows: extract_aggregate
- name: encode_prom
follows: extract_timebased
- name: write_loki
follows: extract_conntrack
parameters:
Expand Down Expand Up @@ -234,6 +236,17 @@ parameters:
- service
- _RecordType
operation: count
- name: extract_timebased
extract:
type: timebased
timebased:
rules:
- name: bandwidth_source_subnet
recordKey: srcSubnet
operation: sum
operationKey: total_value
topK: 5
timeInterval: 1m0s
- name: encode_prom
encode:
type: prom
Expand All @@ -260,17 +273,16 @@ parameters:
- aggregate
buckets: []
- name: bandwidth_per_source_subnet
type: counter
type: gauge
filter:
key: name
value: bandwidth_source_subnet
valueKey: recent_op_value
valueKey: operation_result
labels:
- by
- aggregate
- srcSubnet
buckets: []
- name: connection_size_histogram
type: histogram
type: agg_histogram
filter:
key: name
value: connection_bytes_hist
Expand All @@ -285,7 +297,7 @@ parameters:
- 102400
- 1.048576e+06
- name: connection_size_histogram_ab
type: histogram
type: agg_histogram
filter:
key: name
value: connection_bytes_hist_AB
Expand All @@ -300,7 +312,7 @@ parameters:
- 102400
- 1.048576e+06
- name: connection_size_histogram_ba
type: histogram
type: agg_histogram
filter:
key: name
value: connection_bytes_hist_BA
Expand Down Expand Up @@ -395,7 +407,7 @@ parameters:
- aggregate
buckets: []
- name: flows_length_histogram
type: histogram
type: agg_histogram
filter:
key: name
value: flows_bytes_hist
Expand Down
15 changes: 11 additions & 4 deletions network_definitions/bandwidth_per_src_subnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,24 @@ extract:
- _RecordType
operation: sum
recordKey: bytes
timebased:
rules:
- name: bandwidth_source_subnet
operation: sum
operationKey: total_value
recordKey: srcSubnet
topK: 5
timeInterval: 1m
encode:
type: prom
prom:
metrics:
- name: bandwidth_per_source_subnet
type: counter
type: gauge
filter: {key: name, value: bandwidth_source_subnet}
valueKey: recent_op_value
valueKey: operation_result
labels:
- by
- aggregate
- srcSubnet
visualization:
type: grafana
grafana:
Expand Down

0 comments on commit ef4a155

Please sign in to comment.