Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 1.29 KB

File metadata and controls

39 lines (27 loc) · 1.29 KB

Container Resource Detectors

NuGet version badge NuGet download count badge

Getting Started

You need to install the OpenTelemetry.ResourceDetectors.Container package to be able to use the Container Resource Detectors.

dotnet add package OpenTelemetry.ResourceDetectors.Container --prerelease

Usage

You can configure Container resource detector to the TracerProvider with the following example below.

using OpenTelemetry;
using OpenTelemetry.ResourceDetectors.Container;

var tracerProvider = Sdk.CreateTracerProviderBuilder()
                        // other configurations
                        .ConfigureResource(resource => resource
                            .AddDetector(new ContainerResourceDetector()))
                        .Build();

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

  • ContainerResourceDetector: container.id.

References