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

Cadvisor ignores container renaming #977

Open
GregoryKutuzov opened this issue Nov 25, 2015 · 4 comments
Open

Cadvisor ignores container renaming #977

GregoryKutuzov opened this issue Nov 25, 2015 · 4 comments

Comments

@GregoryKutuzov
Copy link

When a container is renamed in Docker, cAdvisor does not update the container name, but continues to provide the data under the old container name. This means that our storage driver stores irrelevant data and does not reflect the changes that took place on the system.

@ghost
Copy link

ghost commented Apr 7, 2016

I have the same problem.
After container rename, cAdvisor just lost it and only option is to restart cAdvisor.

@vishh
Copy link
Contributor

vishh commented Apr 7, 2016

cAdvisor doesn't reconcile the state of a container after it discovers it
in the beginning. We will have to periodically inspect the container and
update the internal state. Does anyone have some spare cycles to fix this?

On Thu, Apr 7, 2016 at 5:11 AM, psychoche [email protected] wrote:

I have the same problem.
After rename cAdvisor just lost container and only option is restart
cAdvisor.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#977 (comment)

@Cellane
Copy link

Cellane commented Feb 12, 2020

Hello, just found this ticket while I was writing my own ticket about the same problem. I was wondering if there’s any plan or progress on this issue. I’m afraid I might not possess the skills necessary to fix this myself, but if it helps, I can present a scenario in which the existence of this issue breaks any usefulness of cAdvisor.

For my tiny personal server, I use Dokku for managing and deploying applications. Dokku’s default behaviour when deploying a container is to let Docker generate a random name for it at first, and once the container starts and passes health checks, it is renamed to a more useful name in the form of <app-name>.<proc-type>.<#>, for example, cadvisor.web.1 (and the container that is being replaced is renamed to <app-name>.<proc-type>.<#>.<unix-timestamp> until it is despawned a minute later).

What that means is that if all of my apps are started before cAdvisor (or rather, renamed to correct names before cAdvisor starts), everything is fine. But as soon as I start pushing new versions of apps, or changing their configuration (by replacing old containers), the level of useful information I’m getting out of cAdvisor gets progressively worse, as all new apps are forever reporting under the randomly generated name, which is unfortunately not useful at all.

I’m not sure how common my use case/scenario is, but I wonder if there’s any plan to fix this in the future. For the record, I’m observing the issue with cAdvisor 0.34.0.

@badsyntax
Copy link

@Cellane I'm in a similar situation. I was wondering if this workaround is sufficient:

Assuming you're using prometheus, we can graph prom queries in grafana by docker labels instead of container name. Eg for memory usage:

sum(container_memory_rss{name=~".+"}) by (container_label_com_dokku_app_name, container_label_com_dokku_dyno)

Legend:

{{container_label_com_dokku_app_name}}.{{container_label_com_dokku_dyno}}

Seems to me this should be sufficient as the labels won't change, but I'm not that expereinced with this stuff and don't have confidence this is a good workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants