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
421 stars 251 forks source link

RuntimeInstrumentationOptions has no properties #1929

Open mortenbock opened 3 days ago

mortenbock commented 3 days ago

Component

OpenTelemetry.Instrumentation.Runtime

Package Version

Package Name Version
Azure.Monitor.OpenTelemetry.AspNetCore 1.2.0
OpenTelemetry.Instrumentation.Runtime 1.8.1

Runtime Version

net8.0

Description

When I call the .AddRuntimeInstrumentation() extension method, there is an overload that takes an action for RuntimeInstrumentationOptions.

However, when I examine the options object, it has no properties.

Steps to Reproduce

Add the following code to a dotnet 8 web api project:

builder.Services
    .AddOpenTelemetry()
    .UseAzureMonitor()
    .WithMetrics(providerBuilder =>
    {
        providerBuilder.AddRuntimeInstrumentation(options =>
        {
            // Try to set options
            options.
        });
    });

Expected Result

Properties allowing me to configure the metrics collected

Actual Result

No properties exist on the options object.

Additional Context

No response