-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Container Resource MetaData auto detection in Resource SDK #1981
Comments
@pavankrish123 How would you detect the container name in K8s, by the way? I've heard concerns about using the K8s API server for this because of load. |
@jmacd - At least the idea is to tap into container filesystem (different locations for different runtimes) and get whatever information without touching k8 APIs. As you correctly put - accessing K8 apis is definitely not healthy. Here is a feature our team has pushed recently on Java side open-telemetry/opentelemetry-java#3321 to do the same w/o using K8 downward APIs. cc: @lo-jason @stevebappd |
@pavankrish123 This is great to hear. Very cool! |
@jmacd I Fixed the description (Struck off the Good catch 👍🏼 Once the Java one goes through, I can port the changes to golang. |
This interests me because Prometheus goes to great lengths to fill in this kind of name as a label without hammering the k8s API. If we could get basic resource information like this in the SDK itself, would be a huge win. I didn't think it was possible w/o modifying the k8s object... |
Problem Statement
In the spirit of what was done in #1788 #1840 for Process and Operating system auto detection - It is worthwhile to have an auto detection processor that collects and reports container information
container.id
andcontainer.name
.Proposed Solution
Most of the container runtime environments (Docker, CRI-O, and containerd) have this informaton in cgroup files on the container filesystem. Resource SDK initialization goes through these files and fetches it.
Alternatives
Other option is to set environment variables on containers. But that is still sort of manual thing to do or some orchestration agent does it (like K8, PAAS environement)
cc: @stevebappd
The text was updated successfully, but these errors were encountered: