Add host.id resource detector#4843
Conversation
| return SimpleNamespace(stdout=stdout, stderr="", returncode=return_code) | ||
|
|
||
|
|
||
| class HostIdResourceDetectorTest(TestBase): |
There was a problem hiding this comment.
Can we update these tests so that they test as much of the functionality end-to-end as possible? Almost everything is being patched here, which doesn't make these tests that useful. Our CI runs on both Linux and Windows so you should be able to at least test these systems end-to-end.
…, switch statement
| workflows_directory_path, | ||
| "ubuntu-latest", | ||
| additional_jobs={ | ||
| "py312-test-resource-detector-host-latest": ("windows-latest",), |
There was a problem hiding this comment.
not sure if there's a better way for me to run this on windows but scope it to just this test suite?
There was a problem hiding this comment.
You shouldn't need to touch these files at all, you should be able to just have pytest skip the platform specific tests if they don't match
There was a problem hiding this comment.
Look at @pytest.mark.skipif or @unittest.skipIf
There was a problem hiding this comment.
i am using something similar: https://github.com/open-telemetry/opentelemetry-python-contrib/pull/4843/changes#diff-d44fe2506f2682e80ab459c5ef5c010e9bef8f4ff0af3965d47be85c97e00595R58-R61
But i dont see any of the jobs using a windows image?
There was a problem hiding this comment.
if you'd prefer, i can remove all of this to keep it simple for now and followup with a change scoped to just introducing the change to run this on a windows runner. the windows specific tests just won't run for now
Description
This PR adds a
host.idresource detector following the semconv spec, and using the java agent implementation as a reference.Fixes #4830
Type of change
How Has This Been Tested?
I wrote a small test app, and added
Ran the app (on macOS) and observed the attribute
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.