Closed dstj closed 1 year ago
Hey @dstj , thanks for the feedback. I'll investigate why. At the same time, do you intentionally want to set the instrumentation key to empty? And if it is, why? Could you please help me understand your scenario?
@xiaomi7732
Could you please help me understand your scenario?
Sure, in Dev, I don't have a key. Simple as that. I only got keys for Staging and Prod.
Hey @dstj, that totally makes sense to me. So, the issue is actually that you can't disable the profiler for environments that don't need it, and the error it is emitting is annoying, right?
I'll look into what is wrong with the disable switch and why wasn't it preventing the errors.
Hey @dstj, just to let you know, there's a code fix for this issue. Expect this to be delivered in 2.5.1-beta2, ETA sometime next week.
Hi @dsjt, please find the new package here, once the profiler got disabled, there'd be no profiler at all: https://www.nuget.org/packages/Microsoft.ApplicationInsights.Profiler.AspNetCore/2.5.1-beta2
Let me know. And it if works, I will be able to prepare a stable release of the Profiler Agent.
Hi @xiaomi7732,
Just installed v2.5.1-beta2 and my appsettings.Development.json
looks like this:
"ApplicationInsights": {
"InstrumentationKey": ""
},
"ServiceProfiler": {
"IsDisabled": true
},
...
Seems good, no more error message every 5 seconds. Thanks!
That is fantastic. I am glad it works for you. I will keep this issue open until the stable version of it is released.
Stable package released: https://www.nuget.org/packages/Microsoft.ApplicationInsights.Profiler.AspNetCore/2.5.1
I'm upgrading ASP.NET Core 7.0.2 and I also
Microsoft.ApplicationInsights.Profiler.AspNetCore
from 2.4.0 to 2.5.0.Since then, in dev, I get tons of repeated error messages telling me that the Profiler doesn't have a Key and can't run...
In v.2.4.0, only 2 errors appear in the logs upon initialization.
In v2.5.0, I stopped counting, but it's very annoying
Setting
"ServiceProfiler__IsDisabled: true
in theappsettings.json
doesn't do anything, many many log entries.