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

Disable AdaptiveSampling when using UseApplicationInsights #19

Closed
Tadimsky opened this issue May 9, 2018 · 1 comment
Closed

Disable AdaptiveSampling when using UseApplicationInsights #19

Tadimsky opened this issue May 9, 2018 · 1 comment

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;
    });
});
@Tadimsky
Copy link
Author

Tadimsky commented May 9, 2018

Wrong place, sorry - created it here: microsoft/ApplicationInsights-aspnetcore#681

@Tadimsky Tadimsky closed this as completed May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant