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

Tag container count metrics the same way as cgroups metrics #1208

Merged
merged 3 commits into from
Nov 23, 2014

Conversation

LotharSee
Copy link
Contributor

Unify tags on top of docker.containers.running and docker.containers.stopped.
Now both are tagged with image and command.

@remh remh added this to the 5.1.0 milestone Nov 18, 2014
@remh
Copy link
Contributor

remh commented Nov 21, 2014

As said face to face, you shouldn't use Counter metrics for that. You should compute a local sum and sends the metrics as a gauge.

stopped_containers_count = len(all_containers) - len(containers)
self.gauge("docker.containers.stopped", stopped_containers_count, tags=tags)
for container in all_containers:
container_tags = instance.get("tags", [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be outside the loop

@remh
Copy link
Contributor

remh commented Nov 23, 2014

👍

remh added a commit that referenced this pull request Nov 23, 2014
Tag container count metrics the same way as cgroups metrics
@remh remh merged commit 15e196d into master Nov 23, 2014
@remh remh deleted the docker-consistent-tagging branch November 25, 2014 17:09
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.

None yet

3 participants