Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure using the IOptions pattern #343

Closed
MovGP0 opened this issue Nov 18, 2019 · 2 comments
Closed

Configure using the IOptions pattern #343

MovGP0 opened this issue Nov 18, 2019 · 2 comments
Labels
pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Comments

@MovGP0
Copy link

MovGP0 commented Nov 18, 2019

Instead of having a configuration like:

services.AddOpenTelemetry(builder =>
{
    builder
        .SetSampler(Samplers.AlwaysSample)
        .UseJaeger(opts =>
        {
            Configuration.GetSection("Telemetry").GetSection("Jaeger").Bind(opts);
        })
        .AddRequestCollector()
        .AddDependencyCollector();
});

It should look like:

services.AddOpenTelemetry(builder =>
{
    builder
        .SetSampler(Samplers.AlwaysSample)
        .UseJaeger()
        .AddRequestCollector()
        .AddDependencyCollector();
});

services.Configure<JaegerExporterOptions>(Configuration.GetSection("Telemetry").GetSection("Jaeger"));

Details: Options pattern in ASP.NET Core

@MikeGoldsmith
Copy link
Member

Thanks for the suggestion @MovGP0. We'll look into if it's somewhere we want to adopt or if there are any factors that may stop it.

@AlexeiScherbakov
Copy link

Linked with #101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
Development

No branches or pull requests

7 participants