Status | |
---|---|
Stability | Beta |
Code Owners | @Kielek, @lachmatt |
Important
Resources detected by this packages are defined by experimental semantic convention. These resources can be changed without prior notification.
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
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
.