-
Notifications
You must be signed in to change notification settings - Fork 5
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
Label frames with container_id #274
Conversation
src/ddprof_process.cc
Outdated
} | ||
} | ||
++(it->second._sample_counter); | ||
if(!force && (it->second._sample_counter) < k_nb_samples_container_id_lookup) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something I'll want to talk about.
The aim is to avoid a dependency on libdatadog for testing purposes.
Add a test for cgroup lookup
Change the lookup logic to be per PID
600aab7
to
603604c
Compare
Clarify status of container-id field
280f212
to
8679d17
Compare
8679d17
to
c857927
Compare
Fix error when returning ref to temp element
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staggering. This is a tremendous step in the right direction and major context that we were missing. Very happy to see this in the code!
src/ddprof_process.cc
Outdated
return {}; | ||
} | ||
} | ||
container_id = "none"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, interesting. So our default is "unknown"
, but failure to process this upgrades it to "none"
. I think there's value in having a semantic distinction and I think these two values are as good as any other, but in the future we may want to be more descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for highlighting that this was unclear. I added comments.
none
means that it is operating outside a container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staggering. This is a tremendous step in the right direction and major context that we were missing. Very happy to see this in the code!
CI was flaky due to a metric push failing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this is great!
What does this PR do?
Add a label with container_id information
We won't lookup short lived processes.
Motivation
When viewing data from a host, we want to understand if our process is running within a container.
Refer to following issue: #220
Additional Notes
This introduces a ProcessHdr object as an attempt to move some of the responsibilities to this object.
I have a libdatadog PR open : DataDog/libdatadog#169
Though I will not wait for the libdatadog code. Most of the code would be the same.
How to test the change?
I added some unit tests that make sure we are able to read the container_id information.
An end to end test is still missing.