2

i have a situation where i have bunch of already existing asp.net core apps pointed to to their specific app insights instances.

i want all of them to point to another app insights to send a very specific type of logging data without breaking their relation with the app insights instance they are already pointed to.

So is it possible to some how dependency inject 2 different app insights in one application ?

How i understand is that we simply inject AppInsights once like below.

services.AddApplicationInsightsTelemetry(); 

and the we can give instrumentation key in the app settings.

"ApplicationInsights": {  
   "InstrumentationKey": "Copy paste"  
 }  

i am open to any other suggestion to solve this problem aswell.

Raas Masood
  • 1,475
  • 3
  • 23
  • 61

1 Answers1

0

Technically you can initialize 2 different Application Insights object based on 2 different keys & utilize them to track different telemetry.

However you can see the recommendation on when to use single resource according to the documentation,

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396