Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 2.17 KB

File metadata and controls

60 lines (44 loc) · 2.17 KB

Process Resource Detectors

Status
Stability Beta
Code Owners @Kielek, @lachmatt

NuGet version badge NuGet download count badge codecov.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.Process package to be able to use the Process Runtime Resource Detectors.

dotnet add package OpenTelemetry.Resources.Process --prerelease

Usage

You can configure Process Runtime resource detector to the ResourceBuilder with the following example.

using OpenTelemetry;

using var tracerProvider = Sdk.CreateTracerProviderBuilder()
    .ConfigureResource(resource => resource.AddProcessDetector())
    // other configurations
    .Build();

using var meterProvider = Sdk.CreateMeterProviderBuilder()
    .ConfigureResource(resource => resource.AddProcessDetector())
    // other configurations
    .Build();

using var loggerFactory = LoggerFactory.Create(builder =>
{
    builder.AddOpenTelemetry(options =>
    {
        options.SetResourceBuilder(ResourceBuilder.CreateDefault().AddProcessDetector());
    });
});

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

  • ProcessDetector: process.owner, process.pid.

References