How to integrate HockeyApp with Application Insights

Starting from HockeySDK 4.1.1 we introduced integration with Application Insights. Now, having just single HockeySDK in your mobile application you can use features from both powerful products - HockeyApp and Application Insights, where HockeyApp is the leader on Windows Platform for Crash Reporting, Beta Distribution and Application Insights provides a rich experience for custom telemetry reporting.

1. On-boarding to Application Insights

Please note that Application Insights will cause additional costs on your Azure subscription, separate to HockeyApp. For details, please refer to the Application Insights pricing page. Also note that we highly recommend against buying the Enterprise tier as the node-based pricing is not suitable for mobile or desktop apps!

2. Application Insights API

HockeyApp for Windows provides six Application Insights APIs, which we will describe in detail below.

2.1 TrackEvent

HockeyApp provides in an event tracking feature. With Application Insights integration, you can add custom properties with custom values to any event you track.

2.3 TrackTrace

2.4 TrackPageView

In a your mobile application you might want to track a "page" whenever the user opens a pivot or a page in the application. User and session data is sent as properties along with page views, so the user and session charts come alive when there is page view telemetry.

Microsoft.HockeyApp.HockeyClient.Current.TrackPageView(name)

2.5 TrackDependency

Use this api to log the duration and frequency of calls to external components on which your app depends, like HTTP calls or SQL calls.

2.7 Flush

Normally the SDK sends data at times chosen to minimize impact on the user. However, in some cases you might want to flush the buffer - for example, if you are using the SDK in an application that shuts down. Please note, that the function is is synchronous and you need to invoke it only in case there is a real need in it.

Microsoft.HockeyApp.HockeyClient.Flush();

3. Application Insights SDK Migration

If you are using the old Application Insights SDK for Windows, you have three options:

Migrate to HockeySDK, either with your old instrumentation key from Application Insights or the App ID from HockeyApp (see below). This is the recommended option and you will benefit from future features. This is also the only option that enables support for .NET Native crash reporting.

Keep using the Application Insights SDK, either with your old instrumentation key from Application Insights or the App ID from HockeyApp (see below). Please note that we no longer provide updates or bugfixes for the Application Insights SDK. Any support request will be mitigated by migration to HockeySDK.

Review the source code of the Application Insights Core SDK and write you own wrapper for its API. This option is fully at your own risk and we are not able to provide help with this.

Both HockeySDK and Application Insights SDK send the same data format (called "Common Schema") to the same API endpoint, so you can use either SDK under the mentioned constraints. Both SDKs also use the same database for instrumentation keys or App IDs, with the following difference:

HockeySDK expects the App ID to be formatted as a 40-char hex string with no dashes, for example: 0873e2b98ad046a92c170a243a8515f6.

Application Insights SDK expects the instrumentation key formatted as a GUID, so the above example needs to be converted to: 0873e2b9-8ad0-46a9-2c17-0a243a8515f6.

We do not recommend to use both SDKs in the same app, i.e. you need to chose one.