question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

instrumentationKey set later

See original GitHub issue

Hi,

I would like to know if it’s possible to set the instrumentationKey later and not in @NgModule?

ApplicationInsightsModule.forRoot({
    instrumentationKey: 'INSERT_instrumentationKey_HERE'
})

(and not having the log: “An instrumentationKey value is required to initialize AppInsightsService”)

Because depending on my environement I would like to set different “instrumentationKey”.

Thank you

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MarkPieszakcommented, Jun 19, 2017

I don’t think it’d be any harm to have them in there, you’d need to have the keys visible/public either way (whether you typed them in there or not). You should be fine committing them I’d imagine!

0reactions
MarkPieszakcommented, Oct 13, 2017

@saskodh fixed via 2c6c713 thanks to @jycouet

Read more comments on GitHub >

github_iconTop Results From Across the Web

Programmatically set instrumentation key - APM tips
Well, nobody knows the answer better then you. ... Easiest way to configure instrumentation key is to set it in ApplicationInsights.config.
Read more >
instrumentationKey set later · Issue #17 - GitHub
Hi, I would like to know if it's possible to set the instrumentationKey later and not in @NgModule? ApplicationInsightsModule.
Read more >
Create an Application Insights resource - Azure - Microsoft Learn
Manually set up Application Insights monitoring for a new live application. ... The instrumentation key links your telemetry to the resource. Important.
Read more >
Is it possible to set AppInsights instrumentation key at runtime ...
Please try install this package Microsoft.Azure.WebJobs.Logging.ApplicationInsights. Then in your Startup.cs, the code looks like below:
Read more >
Dynamically using Instrumentation Keys with Azure ... - Medium
After setting up Application… ... However, I then needed a way to dynamically set the Instrumentation Key (a configuration key which Application Insights ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found