Skip to content

Commit 5f0aa2d

Browse files
author
aadam19
committed
PVs, PVCs and Ingress metrics
1 parent ed3141e commit 5f0aa2d

4 files changed

Lines changed: 80 additions & 3 deletions

File tree

translator/tocwconfig/sampleConfig/base_container_insights_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ exporters:
123123
- - ClusterName
124124
metric_name_selectors:
125125
- namespace_number_of_running_pods
126+
- namespace_ingress_count
126127
- dimensions:
127128
- - ClusterName
128129
metric_name_selectors:

translator/tocwconfig/sampleConfig/emf_and_kubernetes_config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,28 @@ exporters:
336336
- node_diskio_ebs_ec2_instance_performance_exceeded_iops
337337
- node_diskio_ebs_ec2_instance_performance_exceeded_tp
338338
- node_diskio_ebs_volume_queue_length
339+
- dimensions:
340+
- - ClusterName
341+
- - ClusterName
342+
- Namespace
343+
- - ClusterName
344+
- Namespace
345+
- PersistentVolumeClaimName
346+
metric_name_selectors:
347+
- persistent_volume_claim_status_bound
348+
- persistent_volume_claim_status_lost
349+
- persistent_volume_claim_status_pending
350+
- persistent_volume_claim_count
351+
- dimensions:
352+
- - ClusterName
353+
metric_name_selectors:
354+
- persistent_volume_count
355+
- dimensions:
356+
- - ClusterName
357+
- - ClusterName
358+
- Namespace
359+
metric_name_selectors:
360+
- namespace_ingress_count
339361
metric_descriptors:
340362
- metric_name: apiserver_admission_controller_admission_duration_seconds
341363
overwrite: true

translator/translate/otel/exporter/awsemf/kubernetes.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ func setKubernetesMetricDeclaration(conf *confmap.Conf, cfg *awsemfexporter.Conf
5656

5757
kubernetesMetricDeclarations = append(kubernetesMetricDeclarations, getEBSMetricDeclarations(conf)...)
5858

59+
kubernetesMetricDeclarations = append(kubernetesMetricDeclarations, getVolumesMetricDeclarations(conf)...)
60+
5961
cfg.MetricDeclarations = kubernetesMetricDeclarations
6062
cfg.MetricDescriptors = getControlPlaneMetricDescriptors(conf)
6163

@@ -264,6 +266,7 @@ func getNamespaceMetricDeclarations() []*awsemfexporter.MetricDeclaration {
264266
Dimensions: [][]string{{"Namespace", "ClusterName"}, {"ClusterName"}},
265267
MetricNameSelectors: []string{
266268
"namespace_number_of_running_pods",
269+
"namespace_ingress_count",
267270
},
268271
},
269272
}
@@ -685,3 +688,33 @@ func getEBSMetricDeclarations(conf *confmap.Conf) []*awsemfexporter.MetricDeclar
685688
}
686689
return metricDeclarations
687690
}
691+
692+
func getVolumesMetricDeclarations(conf *confmap.Conf) []*awsemfexporter.MetricDeclaration {
693+
var metricDeclarations []*awsemfexporter.MetricDeclaration
694+
if awscontainerinsight.EnhancedContainerInsightsEnabled(conf) {
695+
metricDeclarations = []*awsemfexporter.MetricDeclaration{
696+
{
697+
Dimensions: [][]string{
698+
{"ClusterName"},
699+
{"ClusterName", "Namespace"},
700+
{"ClusterName", "Namespace", "PersistentVolumeClaimName"},
701+
},
702+
MetricNameSelectors: []string{
703+
"persistent_volume_claim_status_bound",
704+
"persistent_volume_claim_status_lost",
705+
"persistent_volume_claim_status_pending",
706+
"persistent_volume_claim_count",
707+
},
708+
},
709+
{
710+
Dimensions: [][]string{
711+
{"ClusterName"},
712+
},
713+
MetricNameSelectors: []string{
714+
"persistent_volume_count",
715+
},
716+
},
717+
}
718+
}
719+
return metricDeclarations
720+
}

translator/translate/otel/exporter/awsemf/translator_test.go

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func TestTranslator(t *testing.T) {
179179
},
180180
{
181181
Dimensions: [][]string{{"Namespace", "ClusterName"}, {"ClusterName"}},
182-
MetricNameSelectors: []string{"namespace_number_of_running_pods"},
182+
MetricNameSelectors: []string{"namespace_number_of_running_pods", "namespace_ingress_count"},
183183
},
184184
{
185185
Dimensions: [][]string{{"ClusterName"}},
@@ -248,7 +248,7 @@ func TestTranslator(t *testing.T) {
248248
},
249249
{
250250
Dimensions: [][]string{{"Namespace", "ClusterName"}, {"ClusterName"}},
251-
MetricNameSelectors: []string{"namespace_number_of_running_pods"},
251+
MetricNameSelectors: []string{"namespace_number_of_running_pods", "namespace_ingress_count"},
252252
},
253253
{
254254
Dimensions: [][]string{{"ClusterName"}},
@@ -360,7 +360,7 @@ func TestTranslator(t *testing.T) {
360360
},
361361
{
362362
Dimensions: [][]string{{"Namespace", "ClusterName"}, {"ClusterName"}},
363-
MetricNameSelectors: []string{"namespace_number_of_running_pods"},
363+
MetricNameSelectors: []string{"namespace_number_of_running_pods", "namespace_ingress_count"},
364364
},
365365
{
366366
Dimensions: [][]string{{"ClusterName"}},
@@ -516,6 +516,27 @@ func TestTranslator(t *testing.T) {
516516
"node_diskio_ebs_ec2_instance_performance_exceeded_iops", "node_diskio_ebs_ec2_instance_performance_exceeded_tp", "node_diskio_ebs_volume_queue_length",
517517
},
518518
},
519+
{
520+
Dimensions: [][]string{
521+
{"ClusterName"},
522+
{"ClusterName", "Namespace"},
523+
{"ClusterName", "Namespace", "PersistentVolumeClaimName"},
524+
},
525+
MetricNameSelectors: []string{
526+
"persistent_volume_claim_status_bound",
527+
"persistent_volume_claim_status_lost",
528+
"persistent_volume_claim_status_pending",
529+
"persistent_volume_claim_count",
530+
},
531+
},
532+
{
533+
Dimensions: [][]string{
534+
{"ClusterName"},
535+
},
536+
MetricNameSelectors: []string{
537+
"persistent_volume_count",
538+
},
539+
},
519540
},
520541
"metric_descriptors": []awsemfexporter.MetricDescriptor{
521542
{

0 commit comments

Comments
 (0)