Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Disable AdaptiveSampling when using UseApplicationInsights #681

Closed
Tadimsky opened this issue May 9, 2018 · 3 comments
Closed

Disable AdaptiveSampling when using UseApplicationInsights #681

Tadimsky opened this issue May 9, 2018 · 3 comments
Milestone

Comments

@Tadimsky
Copy link

Tadimsky commented May 9, 2018

There is no way to set EnableAdaptiveSampling to false when using the WebHostBuilder extensions.

public static IWebHostBuilder UseApplicationInsights(this IWebHostBuilder webHostBuilder)
{
    webHostBuilder.ConfigureServices(collection =>
    {
        collection.AddApplicationInsightsTelemetry();                
    });

    return webHostBuilder;
}

Should this be possible? Right now I'm having to ditch this extension and do it myself:

webHostBuilder.ConfigureServices(collection =>
{
    collection.AddApplicationInsightsTelemetry((options) =>
    {
        options.InstrumentationKey = appInsightsKey;
        options.EnableAdaptiveSampling = false;
    });
});
@cijothomas
Copy link
Contributor

@Tadimsky
Copy link
Author

Tadimsky commented May 9, 2018

That's what I'm doing. Just thought it would make sense to be able to do this as part of UseApplicationInsights

@cijothomas cijothomas added this to the Future milestone May 9, 2018
@cijothomas
Copy link
Contributor

cijothomas commented May 9, 2018

Got it. I'll tag this as an enhancement.
Ideally I'd have preferred to have just one mechanism to enable AI, but due to historic reasons we have two, each with separate capabilities.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants