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

AddServiceProfiler causes a crash if instrumentation key is not provided #79

Closed
skwasiborski opened this issue Mar 18, 2020 · 5 comments
Assignees
Labels
bug Something isn't working fix available Fix is checked into source control, ready to be released
Milestone

Comments

@skwasiborski
Copy link

In case instrumentation key is not provided AddServiceProvider extension causes crash during asp.net core startup.

An unhandled exception of type 'System.ArgumentNullException' occurred in System.Private.CoreLib.dll: 'Value cannot be null.'
   at Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration..ctor(String instrumentationKey, ITelemetryChannel channel)
   at Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration..ctor(String instrumentationKey)
   at ServiceProfiler.EventPipe.Logging.EventPipeAppInsightsLogger..ctor(String instrumentationKey, ILoggerFactory loggerFactory, IHostingEnvironment hostingEnvironment)

@xiaomi7732 xiaomi7732 self-assigned this Mar 24, 2020
@xiaomi7732
Copy link
Member

xiaomi7732 commented Mar 24, 2020

@skwasiborski Thanks for the report. That behavior is expected because instrumentation key is an essential part of the system to work. What do you think is the best behavior?

@skwasiborski
Copy link
Author

Application Insights normally does not throw when the instrumentation key is not set. Arguably in server setup AI without instrumentation key is as useless as the profiler.

Current behaviour means I cannot run my service locally without providing instrumentation key (which I do not want to do) or modifying my code which I also do not want to do.

In my opinion it the profiler should not throw exceptions in any case, it may log a warning or something.

@xiaomi7732 xiaomi7732 added bug Something isn't working status: investigating Issue in investigating, fix not available yet. labels Mar 25, 2020
@xiaomi7732
Copy link
Member

@skwasiborski, fair enough. I'll make a fix.

@xiaomi7732
Copy link
Member

Fix available:
image
Will be rolled out within the next release.

@xiaomi7732 xiaomi7732 added fix available Fix is checked into source control, ready to be released and removed status: investigating Issue in investigating, fix not available yet. labels Mar 31, 2020
@xiaomi7732 xiaomi7732 added this to the vNext milestone Apr 6, 2020
@xiaomi7732
Copy link
Member

Thanks again for the report. Fix released in:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix available Fix is checked into source control, ready to be released
Projects
None yet
Development

No branches or pull requests

2 participants