Skip to content

Commit

Permalink
Adding new attribute to deployment workload
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjjaramillo committed Apr 21, 2023
1 parent f4ab746 commit 2e1967a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/metric/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,9 @@ var KSMSpecs = definition.SpecGroups{
{Name: "isPaused", ValueFunc: prometheus.FromValue("kube_deployment_spec_paused"), Type: sdkMetric.GAUGE},
{Name: "rollingUpdateMaxPodsSurge", ValueFunc: prometheus.FromValue("kube_deployment_spec_strategy_rollingupdate_max_surge"), Type: sdkMetric.GAUGE},
{Name: "metadataGeneration", ValueFunc: prometheus.FromValue("kube_deployment_metadata_generation"), Type: sdkMetric.GAUGE},
{Name: "isAvailable", ValueFunc: prometheus.FromLabelValue("kube_deployment_status_condition_available", "status"), Type: sdkMetric.ATTRIBUTE},
{Name: "isProgressing", ValueFunc: prometheus.FromLabelValue("kube_deployment_status_condition_progressing", "status"), Type: sdkMetric.ATTRIBUTE},
{Name: "conditionAvailable", ValueFunc: prometheus.FromLabelValue("kube_deployment_status_condition_available", "status"), Type: sdkMetric.ATTRIBUTE},
{Name: "conditionProgressing", ValueFunc: prometheus.FromLabelValue("kube_deployment_status_condition_progressing", "status"), Type: sdkMetric.ATTRIBUTE},
{Name: "conditionReplicaFailure", ValueFunc: prometheus.FromLabelValue("kube_deployment_status_condition_replica_failure", "status"), Type: sdkMetric.ATTRIBUTE},
{Name: "podsMaxUnavailable", ValueFunc: prometheus.FromValue("kube_deployment_spec_strategy_rollingupdate_max_unavailable"), Type: sdkMetric.GAUGE, Optional: true},
{Name: "namespace", ValueFunc: prometheus.FromLabelValue("kube_deployment_labels", "namespace"), Type: sdkMetric.ATTRIBUTE},
{Name: "namespaceName", ValueFunc: prometheus.FromLabelValue("kube_deployment_labels", "namespace"), Type: sdkMetric.ATTRIBUTE},
Expand Down Expand Up @@ -1024,6 +1025,16 @@ var KSMQueries = []prometheus.Query{
Value: prometheus.GaugeValue(1),
},
},
{
MetricName: "kube_deployment_status_condition",
CustomName: "kube_deployment_status_condition_replica_failure",
Labels: prometheus.QueryLabels{
Labels: prometheus.Labels{"condition": "ReplicaFailure"},
},
Value: prometheus.QueryValue{
Value: prometheus.GaugeValue(1),
},
},
{MetricName: "kube_deployment_spec_strategy_rollingupdate_max_unavailable"},
{MetricName: "kube_pod_status_phase", Labels: prometheus.QueryLabels{
Labels: prometheus.Labels{"phase": "Pending"},
Expand Down

0 comments on commit 2e1967a

Please sign in to comment.