Skip to content
This repository has been archived by the owner. It is now read-only.

Integrate with application insights #56

Merged
merged 7 commits into from Jul 6, 2017
Merged

Integrate with application insights #56

merged 7 commits into from Jul 6, 2017

Conversation

@c-w
Copy link
Contributor

@c-w c-w commented Jul 5, 2017

We make use of three application insights apis:

  • trackTrace for log statements
  • trackDependency for call to third-party services
  • trackEvent for first-party scenarios
Smarker
Smarker approved these changes Jul 6, 2017
Copy link
Contributor

@Smarker Smarker left a comment

LGTM with comments

.then(returnValue => {
const duration = new Date() - start;
const success = true;
client.trackEvent(eventName, { duration: duration, success: success });
Copy link
Contributor

@Smarker Smarker Jul 6, 2017

What if you wanted to add other properties to the event like siteType? Or metrics like the number of inserts performed? Would it be more flexible to add a third optional parameter to trackEvent for properties and a fourth optional parameter to it for metrics?

Copy link
Contributor Author

@c-w c-w Jul 6, 2017

Done in 8f9e920 79fd918.

appInsights.setup(appInsightsKey);
appInsights.start();
client = appInsights.getClient(appInsightsKey);
console.log = trackTrace(/* INFO */ 1, consoleLog);
Copy link
Contributor

@Smarker Smarker Jul 6, 2017

Would enumerating the values 1, 2, 3 as INFO, ERROR, WARNING be more clear?

Copy link
Contributor Author

@c-w c-w Jul 6, 2017

@c-w c-w force-pushed the application-insights branch from 8f9e920 to 79fd918 Jul 6, 2017
@c-w c-w force-pushed the application-insights branch from 0a2ae42 to 19f562e Jul 6, 2017
@c-w c-w merged commit 754729c into master Jul 6, 2017
2 checks passed
@c-w c-w deleted the application-insights branch Jul 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants