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

Add docker id to the utilization vendors #207

Merged
merged 1 commit into from
Mar 25, 2020

Conversation

alejandrodnm
Copy link
Contributor

If the agent detects that the app is running inside a container the container ID is added to the utilization map as:

%{docker: %{id: "<CONTAINER_ID>"}}

The conatainer ID is taken from the file "/proc/self/cgroup". It's taken from the first cgroup in the file that meets the following requirements:

  • The definition must contain 3 parts separated by a colon.
  • It must specify the cpu subsystem.
  • The contianer ID is the last item in the cgroup path and it should be a 64-digit hex string.

Fixes #204

@CLAassistant
Copy link

CLAassistant commented Mar 21, 2020

CLA assistant check
All committers have signed the CLA.

@binaryseed
Copy link
Collaborator

Thanks, this is super helpful! I hope to get this pulled in next week (though things in the world are a bit crazy right now)

If the agent detects that the app is running inside a container the
container ID is added to the utilization map as:

%{docker: %{id: "<CONTAINER_ID>"}}

The conatainer ID is taken from the file "/proc/self/cgroup". It's
taken from the first cgroup in the file that meets the following
requirements:

- The definition must contain 3 parts separated by a colon.
- It must specify the cpu subsystem.
- The contianer ID is the last item in the cgroup path and it should
  be a 64-digit hex string.
@alejandrodnm alejandrodnm force-pushed the adn/fetch_container_id branch from a407447 to f93ea6e Compare March 22, 2020 11:43
@binaryseed
Copy link
Collaborator

Thanks, I'm going to merge into a feature branch for a few tweaks!

@binaryseed binaryseed changed the base branch from master to 1.18 March 25, 2020 21:55
@binaryseed binaryseed merged commit c3a2c12 into newrelic:1.18 Mar 25, 2020
@alejandrodnm alejandrodnm deleted the adn/fetch_container_id branch March 25, 2020 22:05
@alejandrodnm alejandrodnm restored the adn/fetch_container_id branch March 26, 2020 19:54
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.

Report Docker container ID
3 participants