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

KuebeletStats receiver, fetch metadata from initContainers #12887

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

dloucasfx
Copy link
Contributor

Signed-off-by: Dani Louca [email protected]

Description:
kubeletstats is throwing the below error.

2022-07-07T15:19:46.365Z warn kubelet/accumulator.go:112 failed to fetch
container metrics {"kind": "receiver", "name": "kubeletstats", "pod":
"init-app-container", "container": "init-example", "error": "failed to
set extra labels from metadata: pod
\"4406a18b-3d22-4b27-bdae-3c89de5f7868\" with container \"init-example\"
not found in the fetched metadata"

The current implementation does not handle init containers correctly;
The code is only looking for ContainerStatuses but the init containers live under InitContainerStatuses instead

Testing:
Unit test was added and manual validation of the fix has been tetsted using the below pod and making sure the error is no longer in the logs.

apiVersion: v1
kind: Pod
metadata:
  name: init-app-container
  labels:
    app: initapp
spec:
  containers:
  - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'sleep 360000']
  initContainers:
  - name: init-example
    image: busybox:1.28
    command: ['sh', '-c', "sleep 20"]

Documentation:

@dmitryax dmitryax merged commit fd6b703 into open-telemetry:main Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants