Skip to content

Commit 5579615

Browse files
committed
TLS WIP
1 parent 1d1fb50 commit 5579615

File tree

4 files changed

+81
-3
lines changed

4 files changed

+81
-3
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: flows.netobserv.io/v1alpha1
2+
kind: FlowMetric
3+
metadata:
4+
name: tls-egress-traffic
5+
namespace: netobserv
6+
spec:
7+
type: Counter
8+
valueField: Bytes
9+
labels: [SrcSubnetLabel,SrcK8S_Namespace,SrcK8S_OwnerName,SrcK8S_OwnerType,DstSubnetLabel,DstK8S_Namespace,DstK8S_OwnerName,DstK8S_OwnerType,Proto,TLSVersion]
10+
direction: Egress
11+
filters:
12+
- field: SrcK8S_Namespace
13+
matchType: Presence
14+
charts:
15+
- dashboardName: TLS
16+
title: "Egress TLS traffic"
17+
unit: percent
18+
type: SingleStat
19+
queries:
20+
- promQL: 'sum(rate(netobserv_tls_egress_traffic{TLSVersion!=""}[2m])) / sum(rate(netobserv_tls_egress_traffic[2m]))'
21+
legend: ""
22+
- dashboardName: TLS
23+
sectionName: Per namespace
24+
title: Egress traffic without TLS
25+
unit: Bps
26+
type: StackArea
27+
queries:
28+
- promQL: 'topk(10, sum(rate(netobserv_tls_egress_traffic{TLSVersion=""}[2m])) by (SrcK8S_Namespace))'
29+
legend: "{{SrcK8S_Namespace}}"
30+
- dashboardName: TLS
31+
sectionName: Per version
32+
title: Egress traffic per TLS version
33+
unit: Bps
34+
type: StackArea
35+
queries:
36+
- promQL: 'topk(10, sum(rate(netobserv_tls_egress_traffic{TLSVersion!~"|.*0x.*"}[2m])) by (TLSVersion))'
37+
legend: "{{TLSVersion}}"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: flows.netobserv.io/v1alpha1
2+
kind: FlowMetric
3+
metadata:
4+
name: tls-ingress-traffic
5+
namespace: netobserv
6+
spec:
7+
type: Counter
8+
valueField: Bytes
9+
labels: [SrcSubnetLabel,SrcK8S_Namespace,SrcK8S_OwnerName,SrcK8S_OwnerType,DstSubnetLabel,DstK8S_Namespace,DstK8S_OwnerName,DstK8S_OwnerType,Proto,TLSVersion]
10+
direction: Ingress
11+
filters:
12+
- field: DstK8S_Namespace
13+
matchType: Presence
14+
charts:
15+
- dashboardName: TLS
16+
title: "Ingress TLS traffic"
17+
unit: percent
18+
type: SingleStat
19+
queries:
20+
- promQL: 'sum(rate(netobserv_tls_ingress_traffic{TLSVersion!=""}[2m])) / sum(rate(netobserv_tls_ingress_traffic[2m]))'
21+
legend: ""
22+
- dashboardName: TLS
23+
sectionName: Per namespace
24+
title: Ingress traffic without TLS
25+
unit: Bps
26+
type: StackArea
27+
queries:
28+
- promQL: 'topk(10, sum(rate(netobserv_tls_ingress_traffic{TLSVersion=""}[2m])) by (DstK8S_Namespace))'
29+
legend: "{{DstK8S_Namespace}}"
30+
- dashboardName: TLS
31+
sectionName: Per version
32+
title: Ingress traffic per TLS version
33+
unit: Bps
34+
type: StackArea
35+
queries:
36+
- promQL: 'topk(10, sum(rate(netobserv_tls_ingress_traffic{TLSVersion!~"|.*0x.*"}[2m])) by (TLSVersion))'
37+
legend: "{{TLSVersion}}"

internal/pkg/helper/cardinality/cardinality.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"XlatDstAddr": "avoid",
6868
"Udns": "careful",
6969
"IPSecStatus": "fine",
70+
"TLSVersion": "fine",
7071
"_RecordType": "fine",
7172
"_HashId": "avoid"
7273
}

internal/pkg/metrics/predefined_metrics.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const (
2323
var (
2424
latencyBuckets = []string{".005", ".01", ".02", ".03", ".04", ".05", ".075", ".1", ".25", "1"}
2525
mapLabels = map[string][]string{
26-
tagNodes: {"K8S_ClusterName", "SrcK8S_Zone", "DstK8S_Zone", "SrcK8S_HostName", "DstK8S_HostName"},
27-
tagNamespaces: {"K8S_ClusterName", "SrcK8S_Zone", "DstK8S_Zone", "SrcK8S_Namespace", "DstK8S_Namespace", "K8S_FlowLayer", "SrcSubnetLabel", "DstSubnetLabel"},
28-
tagWorkloads: {"K8S_ClusterName", "SrcK8S_Zone", "DstK8S_Zone", "SrcK8S_Namespace", "DstK8S_Namespace", "K8S_FlowLayer", "SrcSubnetLabel", "DstSubnetLabel", "SrcK8S_OwnerName", "DstK8S_OwnerName", "SrcK8S_OwnerType", "DstK8S_OwnerType", "SrcK8S_Type", "DstK8S_Type"},
26+
tagNodes: {"K8S_ClusterName", "SrcK8S_Zone", "DstK8S_Zone", "SrcK8S_HostName", "DstK8S_HostName", "TLSVersion"},
27+
tagNamespaces: {"K8S_ClusterName", "SrcK8S_Zone", "DstK8S_Zone", "SrcK8S_Namespace", "DstK8S_Namespace", "K8S_FlowLayer", "SrcSubnetLabel", "DstSubnetLabel", "TLSVersion"},
28+
tagWorkloads: {"K8S_ClusterName", "SrcK8S_Zone", "DstK8S_Zone", "SrcK8S_Namespace", "DstK8S_Namespace", "K8S_FlowLayer", "SrcSubnetLabel", "DstSubnetLabel", "SrcK8S_OwnerName", "DstK8S_OwnerName", "SrcK8S_OwnerType", "DstK8S_OwnerType", "SrcK8S_Type", "DstK8S_Type", "TLSVersion"},
2929
}
3030
mapValueFields = map[string]string{
3131
tagBytes: "Bytes",
@@ -321,6 +321,9 @@ func GetDefinitions(fc *flowslatest.FlowCollectorSpec, allMetrics bool) []metric
321321
if !fc.Processor.IsMultiClusterEnabled() {
322322
labelsToRemove = append(labelsToRemove, "K8S_ClusterName")
323323
}
324+
if !fc.Agent.EBPF.IsTLSTrackingEnabled() {
325+
labelsToRemove = append(labelsToRemove, "TLSVersion")
326+
}
324327

325328
var filterRecordType *metricslatest.MetricFilter
326329
if fc.Processor.LogTypes != nil {

0 commit comments

Comments
 (0)