Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 2.33 KB

File metadata and controls

62 lines (46 loc) · 2.33 KB

Operating System Detectors

Status
StabilityAlpha
Code Owners@Kielek, @lachmatt

NuGet version badgeNuGet download count badgecodecov.io

Important

Resources detected by this packages are defined by experimental semantic convention. These resources can be changed without prior notification.

Getting Started

You need to install the OpenTelemetry.Resources.OperatingSystem package to be able to use the Operating System Resource Detectors.

dotnet add package OpenTelemetry.Resources.OperatingSystem --prerelease

Usage

You can configure Operating System resource detector to the ResourceBuilder with the following example.

usingOpenTelemetry;usingOpenTelemetry.Resources;usingvartracerProvider=Sdk.CreateTracerProviderBuilder().ConfigureResource(resource =>resource.AddOperatingSystemDetector())// other configurations.Build();usingvarmeterProvider=Sdk.CreateMeterProviderBuilder().ConfigureResource(resource =>resource.AddOperatingSystemDetector())// other configurations.Build();usingvarloggerFactory=LoggerFactory.Create(builder =>{builder.AddOpenTelemetry(options =>{options.SetResourceBuilder(ResourceBuilder.CreateDefault().AddOperatingSystemDetector());});});

The resource detectors will record the following metadata based on where your application is running:

  • OperatingSystemDetector: os.type, os.build_id, os.description, os.name, os.version.

References

close