Using application insights in rules

I created a rule which has application insights sdk. This leads to the console.logs from the subsequent rules to be pushed to application insights as trace. However, the logs that are made are inconsistent i.e. If i have 5 console.log statements in 5 rules, I am receiving only 4-8 console.log in application insights from the last three rules. Although i am able to see all 25 logs in webtask live logs

const appInsights = require('applicationinsights@1.8.8');
appInsights.setup(key)
	.setAutoDependencyCorrelation(true)
	.setAutoCollectRequests(true)
	.setAutoCollectPerformance(true)
	.setAutoCollectExceptions(true)
	.setAutoCollectDependencies(true)
  .setAutoCollectConsole(true, true)
	.setUseDiskRetryCaching(true)
	.start();

This was merely an issue of the order of rules. Needed to place this at the top of the rules

1 Like

Hey there!

Glad you have figured it out and thanks for sharing with the rest of community! Yep rules are run exactly in that order so from the top to the bottom

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.