Skip to content

Commit

Permalink
add status_replicas_available/unavailable metrics for kubernetes (aws…
Browse files Browse the repository at this point in the history
  • Loading branch information
movence authored Aug 9, 2023
1 parent 0354092 commit a52e5af
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,20 @@ exporters:
label_matchers: [ ]
metric_name_selectors:
- service_number_of_running_pods
# deployment metrics
# deployment/stateful set/replica set metrics
- dimensions: [ [ ClusterName, Namespace, PodName ], [ ClusterName ] ]
label_matchers: [ ]
metric_name_selectors:
- deployment_spec_replicas
- deployment_status_replicas
- deployment_status_replicas_available
- deployment_status_replicas_unavailable
# daemonset metrics
- replicas_desired
- replicas_ready
- status_replicas_available
- status_replicas_unavailable
# daemon set metrics
- dimensions: [ [ ClusterName, Namespace, PodName ], [ ClusterName ] ]
label_matchers: [ ]
metric_name_selectors:
- daemonset_status_number_available
- daemonset_status_number_unavailable
- daemonset_status_desired_number_scheduled
- daemonset_status_current_number_scheduled
# namespace metrics
- dimensions: [ [ ClusterName, Namespace ], [ ClusterName ] ]
label_matchers: [ ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,20 @@ exporters:
label_matchers: [ ]
metric_name_selectors:
- service_number_of_running_pods
# deployment metrics
# deployment/stateful set/replica set metrics
- dimensions: [ [ ClusterName, Namespace, PodName ], [ ClusterName ] ]
label_matchers: [ ]
metric_name_selectors:
- deployment_spec_replicas
- deployment_status_replicas
- deployment_status_replicas_available
- deployment_status_replicas_unavailable
# daemonset metrics
- replicas_desired
- replicas_ready
- status_replicas_available
- status_replicas_unavailable
# daemon set metrics
- dimensions: [ [ ClusterName, Namespace, PodName ], [ ClusterName ] ]
label_matchers: [ ]
metric_name_selectors:
- daemonset_status_number_available
- daemonset_status_number_unavailable
- daemonset_status_desired_number_scheduled
- daemonset_status_current_number_scheduled
# namespace metrics
- dimensions: [ [ ClusterName, Namespace ], [ ClusterName ] ]
label_matchers: [ ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,20 @@ exporters:
label_matchers: [ ]
metric_name_selectors:
- service_number_of_running_pods
# deployment metrics
# deployment/stateful set/replica set metrics
- dimensions: [ [ ClusterName, Namespace, PodName ], [ ClusterName ] ]
label_matchers: [ ]
metric_name_selectors:
- deployment_spec_replicas
- deployment_status_replicas
- deployment_status_replicas_available
- deployment_status_replicas_unavailable
- replicas_desired
- replicas_ready
- status_replicas_available
- status_replicas_unavailable
# daemon set metrics
- dimensions: [ [ ClusterName, Namespace, PodName ], [ ClusterName ] ]
label_matchers: [ ]
metric_name_selectors:
- daemonset_status_number_available
- daemonset_status_number_unavailable
- daemonset_status_desired_number_scheduled
- daemonset_status_current_number_scheduled
# namespace metrics
- dimensions: [ [ ClusterName, Namespace ], [ ClusterName ] ]
label_matchers: [ ]
Expand Down
3 changes: 1 addition & 2 deletions translator/translate/otel/exporter/awsemf/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func getDeploymentMetricDeclarations(conf *confmap.Conf) []*awsemfexporter.Metri
{
Dimensions: [][]string{{"PodName", "Namespace", "ClusterName"}, {"ClusterName"}},
MetricNameSelectors: []string{
"deployment_spec_replicas", "deployment_status_replicas", "deployment_status_replicas_available", "deployment_status_replicas_unavailable",
"replicas_desired", "replicas_ready", "status_replicas_available", "status_replicas_unavailable",
},
},
}...)
Expand All @@ -205,7 +205,6 @@ func getDaemonSetMetricDeclarations(conf *confmap.Conf) []*awsemfexporter.Metric
Dimensions: [][]string{{"PodName", "Namespace", "ClusterName"}, {"ClusterName"}},
MetricNameSelectors: []string{
"daemonset_status_number_available", "daemonset_status_number_unavailable",
"daemonset_status_desired_number_scheduled", "daemonset_status_current_number_scheduled",
},
},
}...)
Expand Down
14 changes: 6 additions & 8 deletions translator/translate/otel/exporter/awsemf/translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,11 @@ func TestTranslator(t *testing.T) {
},
{
Dimensions: [][]string{{"PodName", "Namespace", "ClusterName"}, {"ClusterName"}},
MetricNameSelectors: []string{"deployment_spec_replicas", "deployment_status_replicas", "deployment_status_replicas_available", "deployment_status_replicas_unavailable"},
MetricNameSelectors: []string{"replicas_desired", "replicas_ready", "status_replicas_available", "status_replicas_unavailable"},
},
{
Dimensions: [][]string{{"PodName", "Namespace", "ClusterName"}, {"ClusterName"}},
MetricNameSelectors: []string{"daemonset_status_number_available", "daemonset_status_number_unavailable",
"daemonset_status_desired_number_scheduled", "daemonset_status_current_number_scheduled"},
Dimensions: [][]string{{"PodName", "Namespace", "ClusterName"}, {"ClusterName"}},
MetricNameSelectors: []string{"daemonset_status_number_available", "daemonset_status_number_unavailable"},
},
{
Dimensions: [][]string{{"Namespace", "ClusterName"}, {"ClusterName"}},
Expand Down Expand Up @@ -398,12 +397,11 @@ func TestTranslator(t *testing.T) {
},
{
Dimensions: [][]string{{"PodName", "Namespace", "ClusterName"}, {"ClusterName"}},
MetricNameSelectors: []string{"deployment_spec_replicas", "deployment_status_replicas", "deployment_status_replicas_available", "deployment_status_replicas_unavailable"},
MetricNameSelectors: []string{"replicas_desired", "replicas_ready", "status_replicas_available", "status_replicas_unavailable"},
},
{
Dimensions: [][]string{{"PodName", "Namespace", "ClusterName"}, {"ClusterName"}},
MetricNameSelectors: []string{"daemonset_status_number_available", "daemonset_status_number_unavailable",
"daemonset_status_desired_number_scheduled", "daemonset_status_current_number_scheduled"},
Dimensions: [][]string{{"PodName", "Namespace", "ClusterName"}, {"ClusterName"}},
MetricNameSelectors: []string{"daemonset_status_number_available", "daemonset_status_number_unavailable"},
},
{
Dimensions: [][]string{{"Namespace", "ClusterName"}, {"ClusterName"}},
Expand Down

0 comments on commit a52e5af

Please sign in to comment.