Skip to content

Commit

Permalink
Revert "Pod age (#87)"
Browse files Browse the repository at this point in the history
This reverts commit dc5e149.
  • Loading branch information
chadpatel committed Sep 15, 2023
1 parent ced73ba commit 3dafdb9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 27 deletions.
18 changes: 8 additions & 10 deletions internal/aws/containerinsight/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ const (
ReplicasDesired = "replicas_desired"
ReplicasReady = "replicas_ready"

RunningPodCount = "number_of_running_pods"
RunningContainerCount = "number_of_running_containers"
ContainerCount = "number_of_containers"
NodeCount = "node_count"
FailedNodeCount = "failed_node_count"
ContainerRestartCount = "number_of_container_restarts"
RunningTaskCount = "number_of_running_tasks"
Age = "age"
RunningPodCount = "number_of_running_pods"
RunningContainerCount = "number_of_running_containers"
ContainerCount = "number_of_containers"
NodeCount = "node_count"
FailedNodeCount = "failed_node_count"
ContainerRestartCount = "number_of_container_restarts"
RunningTaskCount = "number_of_running_tasks"

DiskIOServiceBytesPrefix = "diskio_io_service_bytes_"
DiskIOServicedPrefix = "diskio_io_serviced_"
DiskIOAsync = "Async"
Expand Down Expand Up @@ -162,7 +162,6 @@ const (
// unit
UnitBytes = "Bytes"
UnitMegaBytes = "Megabytes"
UnitSeconds = "Seconds"
UnitNanoSecond = "Nanoseconds"
UnitBytesPerSec = "Bytes/Second"
UnitCount = "Count"
Expand Down Expand Up @@ -281,6 +280,5 @@ func init() {
ContainerCount: UnitCount,
ContainerRestartCount: UnitCount,
RunningTaskCount: UnitCount,
Age: UnitSeconds,
}
}
6 changes: 0 additions & 6 deletions receiver/awscontainerinsightreceiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,6 @@ kubectl apply -f config.yaml
| pod_status_ready | Count |
| pod_status_scheduled | Count |
| pod_status_unknown | Count |
| pod_status_failed | Count |
| pod_status_pending | Count |
| pod_status_running | Count |
| pod_status_succeeded | Count |
| pod_age | Seconds |


| Resource Attribute |
|----------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,6 @@ func (p *PodStore) addStatus(metric CIMetric, pod *corev1.Pod) {
if p.includeEnhancedMetrics {
p.addPodStatusMetrics(metric, pod)
p.addPodConditionMetrics(metric, pod)
podAge := time.Since(pod.CreationTimestamp.Time)
metric.AddField(ci.MetricName(ci.TypePod, ci.Age), podAge.Seconds())
}

var curContainerRestarts int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ const (
PodUnknownMetricName = "pod_status_unknown"
PodReadyMetricName = "pod_status_ready"
PodScheduledMetricName = "pod_status_scheduled"
PodAgeMetricName = "pod_age"
)

func TestPodStore_enhanced_metrics_disabled(t *testing.T) {
Expand Down Expand Up @@ -394,14 +393,6 @@ func TestPodStore_addStatus_adds_pod_succeeded_metric(t *testing.T) {
assert.Equal(t, 1, decoratedResultMetric.GetField(PodSucceededMetricName))
}

func TestPodStore_addStatus_pod_age(t *testing.T) {
decoratedResultMetric := runAddStatusToGetDecoratedCIMetric("./test_resources/pod_in_phase_succeeded.json", true)
year := time.Hour * 24 * 365

assert.Greater(t, decoratedResultMetric.GetField(PodAgeMetricName), 3*year.Seconds())
assert.Less(t, decoratedResultMetric.GetField(PodAgeMetricName), 100*year.Seconds())
}

func TestPodStore_addStatus_enhanced_metrics_disabled(t *testing.T) {
decoratedResultMetric := runAddStatusToGetDecoratedCIMetric("./test_resources/all_pod_conditions_valid.json", false)

Expand Down

0 comments on commit 3dafdb9

Please sign in to comment.