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
fix: Update defect of of wrong resource attribute of "container.id" #1682
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1682 +/- ##
==========================================
- Coverage 91.77% 91.76% -0.02%
==========================================
Files 139 139
Lines 7112 7125 +13
Branches 1427 1431 +4
==========================================
+ Hits 6527 6538 +11
- Misses 585 587 +2
|
Thanks for fixing this! 🙂 Feel free to take the test-data from https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/0f1199620db05a3739cd3bae7e0c408a9bc0d65b/instrumentation/resources/library/src/test/java/io/opentelemetry/instrumentation/resources/CgroupV1ContainerIdExtractorTest.java#L82-L113 and adapt the tests here to use those. 🙂 |
Hello @pichlermarc , I updated the UT code. Please review again. |
Hello, I updated the UT code. Please review again. |
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.
Looks good, just missing some lint fixes it seems 🙂
@pichlermarc, I updated code according to the lint message. It seems the lint result does not show up automatically. Please help review. |
detectors/node/opentelemetry-resource-detector-container/src/detectors/ContainerDetector.ts
Outdated
Show resolved
Hide resolved
…etectors/ContainerDetector.ts
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 again for fixing this 🙂
Which problem is this PR solving?
As described in "#1677", the way to get resource attribute of "container.id" is wrong.
Short description of the changes
I made the changes following the code of OTel Java SDK which works well.
Here is the code I followed:
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java#L54-L60
I have tested the code working well in my Kubernetes environments.