locked
Application Insights / HockeyApp integration with desktop application RRS feed

  • Question

  • We have an existing Windows Desktop application, onto which we've recently been adding hooks to integrate with Application Insights to track usage metrics. We are still in development, but we're putting the next update out within 2 months, which will include the new tracking capabilities.

    We've recently noticed the notification on Application Insights about transitioning into HockeyApps, but it isn't clear if this applies to us, or if we're using the wrong Application Insights application type. Our current test Application Insights end-points are set-up as Windows Store which I imagine is why we got the notifications. I was investigating, and it seems the only application types available now are ASP.NET web applicationJava web applicationOther (preview).

    As previously mentioned, our application is a windows Desktop application, not a web application, and not a mobile application (and not connected to windows store), and we support Windows 7 onwards. Other than being able to integrate with out software, the key functionality we're using is:

    • Event, Exception and Metric tracking - to send back events from within the application
    • Persistence Channel - to buffer events locally if the user isn't currently connected to the web but will be later (this is an ideal scenario feature, but not 100% required)
    • Continuous Export - to export all event data from AI into an Azure blob (we want to run our reporting in Power BI and make it openly available within the company)
    • OS and Device Info - with our events, we attach OS version, device type, model, etc. (again, not critical, but a nice to have. There would be other ways to send this information through)

    Based on this, how should we progress before going live? Should we transfer to Hockey App and expect to maintain the same functionality, or are we ok to stick with Application Insights (perhaps using the Other (preview) application type)?

    All Best, 
    Jose

    Monday, July 18, 2016 2:05 PM

Answers

  • Hi Jose,

    Based on your initial post, it seems like HockeyApp does (or soon will) support all your requirements. Let's go through them one by one:

    • Event, Exception, and Metric tracking: the HockeySDKs available today through the Preseason program contain capabilities to track custom events.

      Applying this to events is straightforward.

      Metrics are also fairly easy: as custom events are simply a key-value pair dictionary, you can  use a <string, double> dictionary to track your metrics. You can see an example of this here.

      Finally, exceptions are a bit more tricky, but can still be instrumented using the same mechanism. You can create a helper method that you would call from within a the catch portion of a try-catch block, say "TrackHandledException":
      public static void TrackHandledException(Exception e)
      {
      	HockeyClient.Current.TrackEvent("CaughtException", new Dictionary<string, string="">
      	{
      		{"ExceptionStack", e.StackTrace },
      		{"ExceptionMessage", e.Message }
      	});
      }
    • The try-catch block will then look as follows:

      try
      {
      	throw new Exception("Example Thrown and Caught Exception");
      }
      catch(Exception exc)
      {
      	TrackHandledException(exc);
      }
    • Persistence channel: what you describe is today the default behaviour of HockeySDK.
    • Continuous export: this today is not available for apps in HockeyApp. It is however something we're working on and soon expect to be available. If your app is already in Application Insights, then following the prompt to link to HockeyApp (pressing the orange bar on top of your Application Insights blade on the Azure Portal) will not at all affect your application, and will simply create a linked HockeyApp app that you can start using and adopting at your own pace. For all of these, please look for a blog post on the Azure Blog outlining details later this week.
    • OS and Device info: As with item 1, can be instrumented via the custom event key-value pair mechanism.

    There's a lot here, so don't hesitate to reach out with any further questions!



    Wednesday, July 20, 2016 9:03 PM

All replies

  • Moving to HockeyApp is probably the right long term solution for you. Right now we are in a transition period so neither service does everything you want on its own however HockeyApp should be able to satisfy all of your requirements soon and we and retiring the Application Insights devices experience soon.

    Todd King - Application Insights team.

    Wednesday, July 20, 2016 12:14 AM
  • Thanks for the reply Todd. What exactly do you mean by 'Application Insights devices experience'? I read on some comments sections from AI->Hockeyapp transition notices that we should be able to maintain AI active and working for our desktop application if, for instance, we create an ASP.NET application type AI resource. 

    Is this the case? Or are you phasing out AI as a whole? The continuous export to an azure storage account is really the one key feature we absolutely need (other than custom events, which HockeyApp can handle), which is why transitioning to Hockeyapp isn't an option for us right now.

    Wednesday, July 20, 2016 8:17 AM
  • Hi Jose,

    Based on your initial post, it seems like HockeyApp does (or soon will) support all your requirements. Let's go through them one by one:

    • Event, Exception, and Metric tracking: the HockeySDKs available today through the Preseason program contain capabilities to track custom events.

      Applying this to events is straightforward.

      Metrics are also fairly easy: as custom events are simply a key-value pair dictionary, you can  use a <string, double> dictionary to track your metrics. You can see an example of this here.

      Finally, exceptions are a bit more tricky, but can still be instrumented using the same mechanism. You can create a helper method that you would call from within a the catch portion of a try-catch block, say "TrackHandledException":
      public static void TrackHandledException(Exception e)
      {
      	HockeyClient.Current.TrackEvent("CaughtException", new Dictionary<string, string="">
      	{
      		{"ExceptionStack", e.StackTrace },
      		{"ExceptionMessage", e.Message }
      	});
      }
    • The try-catch block will then look as follows:

      try
      {
      	throw new Exception("Example Thrown and Caught Exception");
      }
      catch(Exception exc)
      {
      	TrackHandledException(exc);
      }
    • Persistence channel: what you describe is today the default behaviour of HockeySDK.
    • Continuous export: this today is not available for apps in HockeyApp. It is however something we're working on and soon expect to be available. If your app is already in Application Insights, then following the prompt to link to HockeyApp (pressing the orange bar on top of your Application Insights blade on the Azure Portal) will not at all affect your application, and will simply create a linked HockeyApp app that you can start using and adopting at your own pace. For all of these, please look for a blog post on the Azure Blog outlining details later this week.
    • OS and Device info: As with item 1, can be instrumented via the custom event key-value pair mechanism.

    There's a lot here, so don't hesitate to reach out with any further questions!



    Wednesday, July 20, 2016 9:03 PM
  • I thought this might be the case for most things. Good to see that HockeyApp does provide offline caching by default!

    However, we MUST have export to Azure blobs, as we're really not in a position to review our entire analytics stack so close to a release. So would it be safe to send our data through to an ASP.NET application type App Insights resource?

    Thankfully we set-up our analytics stack in such a way that it should be reasonably easy to swap out which tracking system we're using, so it's something we could put out an update to later go straight to Hockey App, but we can't relinquish the export functionality (unless you were to tell me the plug on App Insights is about to be pulled).

    Spot any issues with this approach?

    Thursday, July 21, 2016 3:09 PM