-
Notifications
You must be signed in to change notification settings - Fork 287
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
DependencyMetricsExtractor.ExtractMetrics threw exceptions #549
Comments
@northtyphoon did you by chance re-initialized the processors chain to add CC: @macrogreg |
@pharring can you answer the question? |
CC @macrogreg again to follow up @hallatore do you do any custom telemetry processor chain building? Or you use |
@hallatore @northtyphoon @pharring There are many things that could have gone wrong there and we need some more information to tell specifics. One (of many) things to consider is that if you happened to create the Telemetry Pipeline programmatically, you need to not forget to do something similar to the following for each Telemetry Processor:
|
I have a custom TelemetryProcessor, but it's only appended in the ApplicationInsights.config after the MetricsProcessor. Everything else is default from the config. |
In the early prototypes of Snapshot Collector (which was back then called Exception Exemplification), we used code (as opposed to metadata in ApplicationInsights.config) to add the processor to the TelemetryProcessorChain via the TelemetryProcessorChainBuilder. At that time, the processor didn't implement ITelemetryModule and we certainly did not have any code like the snippet @macrogreg posted. It seems onerous on callers to expect them to re-initialize modules, like that. Shouldn't that happen inside |
@pharring - This is a good point. We should look into the possibility of this more closely. However, as an immediate workaround in case that you do, indeed, build your chain programmatically - does the above recommendation help? |
@hallatore - In that case there may be something wrong with the general module initialization logic. |
We are initializing ai from code with the following.
What is the correct code change to fix this? |
Hi @hallatore , Please try running my sample after you invoke the .Build() method. |
This looks right @macrogreg? TelemetryConfiguration.Active.TelemetryProcessorChainBuilder
.Use((tp) => new IgnorePostDeployPrimingTelemetryProcessor(tp))
.Build();
foreach (var processor in TelemetryConfiguration.Active.TelemetryProcessors)
{
var telemetryModule = processor as ITelemetryModule;
if (telemetryModule != null)
{
telemetryModule.Initialize(TelemetryConfiguration.Active);
}
} |
The code above fixed it. But it feels like this should be handled automatically. |
@macrogreg will be fixing this in 2.5.0-beta1 |
@cijothomas - in regard to the comment above - what we will be fixing in 2.5-betaX is that the diagnostic info is logged without the need for a first chance exception. However, I think that the folks on this thread are asking for is that we improve the programmatic building of the pipeline such that the telemetryModule.Initialize(..) calls described earlier are not necessary. While I am in full support of such an upgrade, it is not a planned work item for 2.5-betaX from my perspective. The Core SDK team needs to consider how it fits into the team's priorities. |
I just updated from 2.3 to 2.4 and this started posing all over my dev env... other than this msg, everything seems to be working fine... will this msg also pop in prod env or just while DeveloperMode is true? |
I'm having the same issue: No idea what can it be. My references are up to date. Suggestions? |
@andreujuanc i updated to 2.4.1 and it's all gone |
There is some serious problem with my configuration after upgrading to 2.4 version, not only version 2.2 AppinsightsConfig - https://pastebin.com/raw/ngQV7pR9 I aslo use this configuration during stratup
To eliminate fast dependencies, and also to eliminate SQL dependencies, because of the monthly data cap in azure free tier. |
@vmachacek happened to me too... i figured out that the update (when done via application insight integrated vs search) sets your telemetry key on the shared "layout.cshtml", web.config, applicationinsightsConfig... you need to reset all of those by yourself... after reseting, it all went back to normal |
The code snippet suggested by @macrogreg resolved the issue for me as well. Here's a slightly more elegant version: public static void InitializeProcessorModules()
{
var telemetryConfig = TelemetryConfiguration.Active;
foreach (var module in telemetryConfig.TelemetryProcessors.OfType<ITelemetryModule>())
{
module.Initialize(telemetryConfig);
}
} |
@SergeyKanzhelev, can you make the architecture decision: |
Yes, we should re-initialize all processors on the chain re-build |
We observed the behavior in some ETL traces we collected. I attached one sample call stack.
"ExceptionMessage Cannot execute ExtractMetrics because this metrics extractor has not been initialized (no metrics manager)."
The text was updated successfully, but these errors were encountered: