You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation on how the value should be obtained per OS is self-explanatory: part of the current implementation for WithOSDescription should be re-used.
WithOSName
For Unix/Linux, we can use the NAME value from the os-release file.
For Windows, we can use the ProductName registry value from SOFTWARE\Microsoft\Windows NT\CurrentVersion.
For Darwin, we can use the ProductName property value from the plist system files.
WithOSVersion
For Unix/Linux, we can use the VERSION value from the os-release file.
For Windows, we can use the DisplayVersion registry value from SOFTWARE\Microsoft\Windows NT\CurrentVersion.
For Darwin, we can use the ProductVersion property value from the plist system files.
Additional Context
Regarding WithOSName and WithOSVersion, I am not 100% certain that those are right values to be used: please advise if you think it should be something else.
We won't be adding those in the main SDK, as those are too dependent on the platform (it's not just about OS, but the cloud platform too).
I see the azure detector already adds those.
Adding them to the other detectors would be find.
We could possibly have a baremetal (not sure about the name) detector.
First, the host namespace is not stable yet.
So adding support for more attributes in a stable SDK poses the risk of complicated migrations in the future if there are breaking changes.
host.id has an explicit spec (in the same doc above) on how it should be retrieved.
Finally, detectors are thought to be extensible. It's much more easier and modular to have smaller external detectors than everything in the same location.
Problem Statement
At the moment only
WithOSDescription
andWithOSType
are implemented in go.opentelemetry.io/otel/sdk/resource. If we refer to the latest tagged version of open-telemetry/semantic-conventions/docs/resource/os.md, we should also haveWithOSBuildID
,WithOSName
andWithOSVersion
.Proposed Solution
WithOSBuildID
The documentation on how the value should be obtained per OS is self-explanatory: part of the current implementation for
WithOSDescription
should be re-used.WithOSName
NAME
value from theos-release
file.ProductName
registry value fromSOFTWARE\Microsoft\Windows NT\CurrentVersion
.ProductName
property value from the plist system files.WithOSVersion
VERSION
value from theos-release
file.DisplayVersion
registry value fromSOFTWARE\Microsoft\Windows NT\CurrentVersion
.ProductVersion
property value from the plist system files.Additional Context
Regarding
WithOSName
andWithOSVersion
, I am not 100% certain that those are right values to be used: please advise if you think it should be something else.I stumbled upon open-telemetry/opentelemetry-collector-contrib#39941 some time ago and noticed that those APIs were missing from the SDK. For example, it uses its own implementation for
OSVersion
instead of the SDK implemention like it's done forOSType
.The text was updated successfully, but these errors were encountered: