open-telemetry / opentelemetry-dotnet-contrib

This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
https://opentelemetry.io
Apache License 2.0
454 stars 273 forks source link

[Resources.OperatingSystem] Implement additional osdetector attributes #1983

Closed ysolomchenko closed 4 weeks ago

ysolomchenko commented 1 month ago

Fixes https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/1957

Changes

Implement additional Operating System Detector attributes https://github.com/open-telemetry/semantic-conventions/blob/main/docs/resource/os.md

The data detected by our detector comes from the same sources as those used by the opentelemetry-go detector.

Merge requirement checklist

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 79.66102% with 24 lines in your changes missing coverage. Please review.

Project coverage is 80.00%. Comparing base (71655ce) to head (50f5935). Report is 395 commits behind head on main.

Files with missing lines Patch % Lines
...sources.OperatingSystem/OperatingSystemDetector.cs 84.25% 17 Missing :warning:
...atingSystem/OperatingSystemResourcesEventSource.cs 30.00% 7 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1983/graphs/tree.svg?width=650&height=150&src=pr&token=DG2DEROH83&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1983?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #1983 +/- ## ========================================== + Coverage 73.91% 80.00% +6.08% ========================================== Files 267 3 -264 Lines 9615 130 -9485 ========================================== - Hits 7107 104 -7003 + Misses 2508 26 -2482 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1983/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [unittests-Resources.OperatingSystem](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1983/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `80.00% <79.66%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1983?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [...atingSystem/OperatingSystemResourcesEventSource.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1983?src=pr&el=tree&filepath=src%2FOpenTelemetry.Resources.OperatingSystem%2FOperatingSystemResourcesEventSource.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuUmVzb3VyY2VzLk9wZXJhdGluZ1N5c3RlbS9PcGVyYXRpbmdTeXN0ZW1SZXNvdXJjZXNFdmVudFNvdXJjZS5jcw==) | `30.00% <30.00%> (ø)` | | | [...sources.OperatingSystem/OperatingSystemDetector.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1983?src=pr&el=tree&filepath=src%2FOpenTelemetry.Resources.OperatingSystem%2FOperatingSystemDetector.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkuUmVzb3VyY2VzLk9wZXJhdGluZ1N5c3RlbS9PcGVyYXRpbmdTeXN0ZW1EZXRlY3Rvci5jcw==) | `83.89% <84.25%> (ø)` | | ... and [268 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet-contrib/pull/1983/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)
ysolomchenko commented 1 month ago

The Docker image doesn’t include an OS build ID, which is causing test errors. We need to find a way to track or include build IDs to resolve this issue.