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 auto-detection of container information to resource #3308

Closed
lo-jason opened this issue Jun 10, 2021 · 4 comments
Closed

Add auto-detection of container information to resource #3308

lo-jason opened this issue Jun 10, 2021 · 4 comments

Comments

@lo-jason
Copy link
Contributor

Is your feature request related to a problem? Please describe.
All process information is captured ootb by auto-instrumentation agent today. Having auto-detection of container information is along the same lines.

Describe the solution you'd like
By reading the cgroup information inside the container filesystem, the agent can then automatically attach container information when it exists to the resource header.

Describe alternatives you've considered
Downward API supports exposing the container information, but this requires manual changes in deployment artifact. Inside the collector, the k8s_processor supports correlation to a pod. The pod is not granular enough since one pod can contain multiple services.

cc @pavankrih123

@iNikem
Copy link
Contributor

iNikem commented Jun 11, 2021

@lo-jason Does spec semantic convention define those resources that you are interested in?

@anuraaga anuraaga transferred this issue from open-telemetry/opentelemetry-java-instrumentation Jun 11, 2021
@anuraaga
Copy link
Contributor

@lo-jason I've transferred this issue to the opentelemetry-java repo where we have a few resource detectors. A k8s resource detector to fill https://github.com/open-telemetry/opentelemetry-specification/blob/main/semantic_conventions/resource/k8s.yaml would be nice to have I think.

@lo-jason
Copy link
Contributor Author

@lo-jason Does spec semantic convention define those resources that you are interested in?

yes container.id

jkwatson pushed a commit that referenced this issue Jul 21, 2021
* Support adding container.id to resource metadta

* Address review comments

* Address review feedback

* Change containerResource to cached Resource factory

* Make method private

* Change to Paths and Files

* Fix bad merge and change regex

* Remove debug code, remove regex

* Add nullable annotation

Co-authored-by: Anuraag Agrawal <[email protected]>
@jkwatson
Copy link
Contributor

This is done. Not sure why it didn't get closed.

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

No branches or pull requests

4 participants