Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENG-3562 : Added K8s Container Waiting Reason #90

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions receiver/k8sclusterreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ Current status reason of the pod (1 - Evicted, 2 - NodeAffinity, 3 - NodeLost, 4
| k8s.clusterrolebinding.type | The type of the Cluster Role Binding. | Any Str | true |
| k8s.clusterrolebinding.uid | The UID of the Cluster Role Binding. | Any Str | true |
| k8s.container.name | The k8s container name | Any Str | true |
| k8s.container.status.current_waiting_reason | Current waiting reason of the Container. | Any Str | true |
| k8s.container.status.last_terminated_reason | Last terminated reason of a container. | Any Str | true |
| k8s.cronjob.name | The k8s CronJob name | Any Str | true |
| k8s.cronjob.start_time | The start time of the Cronjob. | Any Str | true |
Expand Down
1 change: 0 additions & 1 deletion receiver/k8sclusterreceiver/generated_package_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions receiver/k8sclusterreceiver/internal/container/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ func RecordSpecMetrics(logger *zap.Logger, mb *imetadata.MetricsBuilder, c corev
if cs.LastTerminationState.Terminated != nil {
rb.SetK8sContainerStatusLastTerminatedReason(cs.LastTerminationState.Terminated.Reason)
}
if cs.State.Waiting != nil {
rb.SetK8sContainerStatusCurrentWaitingReason(cs.State.Waiting.Reason)
}
break
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions receiver/k8sclusterreceiver/internal/metadata/testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ all_set:
enabled: true
k8s.container.name:
enabled: true
k8s.container.status.current_waiting_reason:
enabled: true
k8s.container.status.last_terminated_reason:
enabled: true
k8s.cronjob.name:
Expand Down Expand Up @@ -525,6 +527,8 @@ none_set:
enabled: false
k8s.container.name:
enabled: false
k8s.container.status.current_waiting_reason:
enabled: false
k8s.container.status.last_terminated_reason:
enabled: false
k8s.cronjob.name:
Expand Down Expand Up @@ -831,6 +835,10 @@ filter_set_include:
enabled: true
metrics_include:
- regexp: ".*"
k8s.container.status.current_waiting_reason:
enabled: true
metrics_include:
- regexp: ".*"
k8s.container.status.last_terminated_reason:
enabled: true
metrics_include:
Expand Down Expand Up @@ -1353,6 +1361,10 @@ filter_set_exclude:
enabled: true
metrics_exclude:
- strict: "k8s.container.name-val"
k8s.container.status.current_waiting_reason:
enabled: true
metrics_exclude:
- strict: "k8s.container.status.current_waiting_reason-val"
k8s.container.status.last_terminated_reason:
enabled: true
metrics_exclude:
Expand Down
5 changes: 5 additions & 0 deletions receiver/k8sclusterreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,11 @@ resource_attributes:
type: string
enabled: true

k8s.container.status.current_waiting_reason:
description: Current waiting reason of the Container.
type: string
enabled: true

k8s.daemonset.start_time:
description: "The start time of the Daemonset."
enabled: true
Expand Down
Loading