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

Conversation

Projects
None yet
2 participants
@c-w
Copy link
Member

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

left a comment

LGTM with comments

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

This comment has been minimized.

Copy link
@Smarker

Smarker Jul 6, 2017

Contributor

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?

This comment has been minimized.

Copy link
@c-w

c-w Jul 6, 2017

Author Member

Done in 8f9e920 79fd918.

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

This comment has been minimized.

Copy link
@Smarker

Smarker Jul 6, 2017

Contributor

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

This comment has been minimized.

Copy link
@c-w

c-w Jul 6, 2017

Author Member

@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

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@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.
You can’t perform that action at this time.