IBM-MIL / IBM-Ready-App-for-Telecommunications

An Android Ready App that allows users to dynamically manage their data/talk/text plans while utilizing material design, MVP architecture, and reactive programming.
Other
33 stars 22 forks source link

Operational Analytics custom data is not displaying in the analytics console. #15

Open tannerpreiss opened 8 years ago

tannerpreiss commented 8 years ago

We received an issue via email from a MFP Solution Architect

begin email As advised, I'm setting up an Operational Analytics demo with the Telco Ready App by manually generating the custom events from the app itself. But I could need see any of the custom events generated from the app in the Analytics dashboard. Using the Android Studio to run the app on a Android Emulator, I could see the WL.Analytics.log and send debug messages in the Android logcat e.g.

12-09 13:17:22.841 2119-2119/com.ibm.mil.readyapps.telco I/TEST: PAGE_TRANSITION : {"dstPage":"wifi_page","srcPage":"myplan_page","timestamp":1449627442841,"_activity":"pageTransition","myplan_page_dwellTime":1.449627165211E9} 12-09 13:17:22.883 2119-2151/com.ibm.mil.readyapps.telco D/wl.request: WLRequestSender.run in WLRequestSender.java:40 :: Sending request http://192.168.0.13:10080/TelcoReadyAppMFP/apps/services/loguploader 12-09 13:17:22.895 2119-2151/com.ibm.mil.readyapps.telco D/com.worklight.wlclient.WLRequest: WLRequest.requestFinished in WLRequest.java:321 :: requestFinished with status: 201

However, in the MFP v7.1 backend, there were no custom events available when I tried to configure a custom report. In the Analytics -> Administration page, the number of Custom Data documents is zero. I could see the device, adapter calls, client and server logs on the Analytics dashboard. Only the custom events from the client app are not available nor visible. I'm using the embedded server of the MFP v7.1 Studio as my MFP backend. end email

Summary : custom data from the Android emulator is not displaying in the analytics console.

Background

tannerpreiss commented 8 years ago

I did the following debugging:

  1. Downloaded MFP CLI 7.1
  2. run mfp push
  3. open the project and change wl.properties to point to 10.0.2.2 for Android emulator to hit computers local instance of mfp server.
  4. Run the application (which is on MFP SDK 7.0) and the log messages are getting 201's (implying a success)

Log for step 4:

12-09 11:49:41.225 20883-20924/com.ibm.mil.readyapps.telco D/wl.request: WLRequestSender.run in WLRequestSender.java:40 :: Sending requesthttp://10.0.2.2:10080/TelcoReadyAppMFP/apps/services/loguploader 12-09 11:49:41.231 20883-20924/com.ibm.mil.readyapps.telco D/com.worklight.wlclient.WLRequest: WLRequest.requestFinished in WLRequest.java:321 :: requestFinished with status: 201

  1. Then go to the Operational Analytics Console at http://localhost:10080/analytics/console/customCharts and create a chart but no data is there. There is no custom activities however I do see the sessions from my android emulator showing up in the default analytics console, so i know that the emulator is actually connecting to my local instance.
  2. Then I went into adb and looked for the actual log files on the Android phone and downloaded the following logs. For the convenience of looking at the logs I added array characters at the beginning and end of the file so that I could format them in Sublime, other than that the data is unchanged in the log file. I have included the file as an attachment

It seems the data is logging correctly using the MFP SDK 7.0 but the server which is running MFP 7.1 is not showing the custom activities. It should also be noted that the MFP server and client (Android) code was originally created using MFP 7.0 and then when you run mfp push it does a migration.

I am wondering : a) Did the formatting from MFP 7.0 to MFP 7.1 of the custom activity JSON change between versions and therefore the custom charts can't scrape the data? b) I noticed that the Operational Analytics SDK changed slightly. For example logging custom activities in 7.0 was WLAnalytics.log() but now there is an extra period and it is WL.Analytics.log() , I assume the implementation details are probably the same under the hood but the interface changed so im not sure if we need SDK for 7.1 to speak to 7.1 server.

tannerpreiss commented 8 years ago

I went and visited the MFP Operational Analytics team in Austin for a debugging session and after a few hours of debugging we found the issue.

The issue is in the Operational Analytics 7.1 product team code and we have since filed a PMR addressing the issue.

quick bug summary: our choice of JSON keywords in the custom_data payload for custom analytics is now conflicting with the code in Operational Analytics 7.1.

Quickfix : below is a "quickfix" that will address the issue and will allow custom analytics to appear while the PMR gets resolved by the Operational Analytics product team.

  1. Navigate to the following class on your local machine: https://github.com/IBM-MIL/IBM-Ready-App-for-Telecommunications/blob/master/TelcoReadyAppAndroid/app/src/main/java/com/ibm/mil/readyapps/telco/analytics/AnalyticsPageTransition.java and change the timestampfield to currentTime.
  2. Navigate to the following class on your local machine: https://github.com/IBM-MIL/IBM-Ready-App-for-Telecommunications/blob/master/TelcoReadyAppAndroid/app/src/main/java/com/ibm/mil/readyapps/telco/analytics/AnalyticsPlanChange.java and change the timestamp field to currentTime.
kkkum commented 8 years ago

The "quickfix" works. Thanks!