Skip to content
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

METRICS: P0: Ensure tracing telemetry being logged in Application Insights Trace #624

Closed
daveta opened this issue Nov 12, 2018 · 4 comments
Assignees
Labels
4.2 December 15, 2018 Release

Comments

@daveta
Copy link
Contributor

daveta commented Nov 12, 2018

Title: METRICS: P0: Ensure tracing telemetry being logged in Application Insights Trace

Application Insights has ability to intercept ILogger events (in C#), find out equivalent in NodeJS - make sure this is turned on for all samples. Add to documentation.

@daveta daveta added 4.2 December 15, 2018 Release Approved labels Nov 12, 2018
@benbrown
Copy link
Contributor

Theoretically this means intercepting messages sent to console.*

@daveta
Copy link
Contributor Author

daveta commented Nov 22, 2018

@benbrown: Haven't tested, but I think the way to enable the console hook is
.setAutoCollectConsole(true).

Here's the blurb:
https://github.com/Microsoft/ApplicationInsights-node.js/#configuration

If you agree, we can probably close this.
I think this matches reasonably close what we're doing on C#:

appInsights.setup(appInsightsSettings.instrumentationKey)
    .setAutoDependencyCorrelation(true)
    .setAutoCollectRequests(true)
    .setAutoCollectPerformance(true)
    .setAutoCollectExceptions(true)
    .setAutoCollectDependencies(true)
    .setAutoCollectConsole(true)
    .start();

@benbrown
Copy link
Contributor

Looks like we need it to be .setAutoCollectConsole(true, true) to get the actual console.logs, which I believe is what we're trying to do.

To be clear, this would capture ALL debug/trace output that would normally go to the terminal.

@benbrown
Copy link
Contributor

OK I can confirm that calling .setAutoCollectConsole(true, true) will capture all console.logs and send them to Applicaiton Insights as TRACE events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.2 December 15, 2018 Release
Projects
None yet
Development

No branches or pull requests

2 participants