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

Inconsistent & stale metrics reported for a docker container which was restarted #2791

Open
amolfound opened this issue Jan 27, 2021 · 3 comments

Comments

@amolfound
Copy link

amolfound commented Jan 27, 2021

Using:
cadvisor v36
docker image: debian8

While querying the /metrics endpoint i receive inconsistent entries for a container which was restarted a while back. For eg. if i query the metrics endpoint 10 times. 5 times i would receive 1st one and other 5 times the second one
`49444.206645393 1607337449406 ---> timestamp corresponds to 7 December 2020

40299.534580353 1600434184085 ---> timestamp corresponds to 18 September 2020`

the first one corresponds to entry from the latest new container. The second is from the instance which was shutdown before the restart

cgroup parent of the container
"CgroupParent": "/system.slice/<service-name>",

in the code we use 2minutes as maxage while creating the inmemorycache here : https://github.com/google/cadvisor/blob/master/cache/memory/memory.go
which is used in the cadvisor manger.

The above config setting should ideally not allow entries older than 2minutes. Here the entry is months old.

@iwankgb
Copy link
Collaborator

iwankgb commented Feb 12, 2021

@amolfound, can you check if #2800 fixed your problem, please?

@amolfound
Copy link
Author

amolfound commented Feb 16, 2021

@iwankgb : i believe #2800 is a different issue.

My issue i infered is caused by stale cgroups inside cgroup parent of the service.
"CgroupParent": "/system.slice/",

So randomly one of these entries is picked up by cadvisor at a time which is causing the issue

@mrliptontea
Copy link

I wonder if #2844 is related? It's a bit different problem though.

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

No branches or pull requests

3 participants