VBUC Telemetry Update

Summary

Important questions

  • What data is collected?

    • Information about the way in which the VBUC is used

      • Licenses and data about execution

      • Every step of the migration

      • The buttons that are clicked

      • Etc...

    • Information related to failures in the VBUC

    • At the end of the day, a mail is sent to Sales, containing the list of people who ran the VBUC, and the owner of their account (if there is any)

      • This information is collected from the Hubspot

    • In Hubspot, there is a VBUC log, in which the sessions for each user are stored (a User has a property related to the VBUC log)

  • Where is this data stored?

    • Initially, in Azure Storage. However, this is not the place from which it is being read by people

      • The Azure Storage table can be accessed using this connection string:

        • PrimaryKey: Rhjf19Jt9BvYtLopQ7Yo0+7tXZM3UGvWBQ4NcyrqIZiGpJYLAIQKEIHz2ZsXQ70BebDNAmNgrWHBpWFKkt+NPA== PrimaryConnectionString: AccountName=studiotelemetria;AccountKey=Rhjf19Jt9BvYtLopQ7Yo0+7tXZM3UGvWBQ4NcyrqIZiGpJYLAIQKEIHz2ZsXQ70BebDNAmNgrWHBpWFKkt+NPA==;EndpointSuffix=core.windows.net;DefaultEndpointsProtocol=https;

    • After being in the Azure Storage, this data is moved into a relational database

    • Also, there is some information that is collected and sent through the Hubspot API. This means there will be information stored in Hubspot

  • How is this data collected in runtime?

    • A class used for Telemetry is called in multiple locations in the code of the VBUC (very standard)

  • The full process of telemetry data collection:

    • The VBUC is executed

      • During this execution, the VBUC calls methods that upload information to the Azure Storage

    • A webjob processes the information that was uploaded to the Azure Storage

      • Some data is uploaded to Hubspot, using the Hubspot API (as of the 23/07/2021, there was an issue with this workflow: the code which is running currently is not the same as it its on the repo. Francisco Rangel had to de-compile this code)

      • The data is uploaded to a relational database

    • There is a diagram related to this process (not the final design):

Telemetry Prototype Design

Challenges

There are multiple areas in which we are not sure if the implementation is feasible (mainly for XP)

Windows XP Compatibility

Hubspot

The Hubspot API might require a security protocol not supported by Windows XP (for instance: TLS 1.2)

Microsoft.Application Insights

The last version of the Microsoft.ApplicationInsights nuget that is supported on Windows XP is the 2.4.0. After running a small program (which only adds two numbers and then reports to the AssessmentWebAPI Application Insights resource) in Windows 10 and Windows XP, the event from Windows 10 was tracked, but the event from Windows XP was not. The initial thought was that maybe this was caused because of the issue with TLS. There is a discussion in StackOverflow about this, but it does not seem likely (based on the answers): https://stackoverflow.com/questions/63358585/what-ssl-version-is-used-to-log-data-to-application-insights-from-desktop-applic

Communication with Azure APIs

The Azure APIs, by default are set to communicate with TLS 1.2 or better. TLS 1.2 is not supported by Windows XP and there would be the need to develop a work around in order to allow for the communication with an API. The API can be set to communicate with an older version of TLS. However, the last time we tried this, it still did not work.

Unforeseen problems

The last time we tried to set the communication with the AssessmentAPI, we could not do it even when setting the API to communicate with a previous version of TLS 1.2. The error in the communication was not clear.

Software Architecture needed to support the requirements of the VBUC Telemetry

Extraction of the IControllerMonitor from the Controller

  • The IControllerMonitor could be outside of the Controller

    • There is no problem with creating an implementation of IControllerMonitor that is external to the Controller.

    • After all, the IControllerMonitor is passed as a dependency to the Controller

    • In a similar way, an IControllerMonitor could be passed to another tool

    • There might be a problem because of the parameters of type CodeProcessorDescriptor

      • We could use a CodeProcessorDescriptor always, even in tools that do not use the Controller

      • We could remove these parameters. In the ControllerMonitor (used by the Controller), we could have the CodeDescriptor as a field of the class. This could cause problems if we implement multiple CodeDescriptors

      • We could overload the methods that receive a CodeProcessorDescriptor

There is a related PBI that can be found at: Product Backlog Item 408779: [Telemetry][Spike] Define how to extract the Telemetry Monitor from the Controller?

Telemetry API

  • This Telemetry API should be able to be reached from Windows XP

  • This Telemetry API should be able to process events sent from different products, not only VBUC

  • We would have to provide the instrumentation keys or have some mechanism to access the correct instrumentation key depending on the name of the product that sent an event

  • Maybe we should think about API versioning for this case: https://www.infoworld.com/article/3562355/how-to-use-api-versioning-in-aspnet-core.html

  • There might be a need for a separate component that will complement the functionality of this API (such as a webjob) if we want to make "daily summaries"

There is a related PBI that can be found at: Product Backlog Item 408777: [Telemetry][TelemetryAPI][Spike] Define how to implement a Telemetry API

All Events

The following events are reported and stored in the VBUC Database. Most of them are sent using TelemetriaProxy.Instance.ReportEvent()

  • Activation Browse License

    • Attributes

    • ClientTimestamp

    • Message

      • Possible values

        • File Chosen

        • Aborted

    • Name

    • Sent from VBUC > src > Manager > Shell > ViewModel > WindowsDialogServices > LegacyForms > frmLicenseActivator

  • Activation Download Trial

    • Sent from VBUC > src > Manager > Shell > ViewModel > WindowsDialogServices > LegacyForms > frmLicenseActivator

    • Attributes

      • ClientTimestamp

      • Name

      • Message

        • Possible values

          • found

          • not found

      • email

        • Is optional, apparently (found on session 7AC3E398-2D3E-474A-A537-CBA8267BCE33)

  • Activation End

    • Sent from VBUC > src > Manager > Shell > SolutionManagement > ReportView

    • Attributes

      • ClientTimestamp

      • Company

        • Examples

          • Strapper Constructions

          • <EmptyString>

      • DateRegistered

      • ExpirationDate

      • IsTrial

        • Example: true

      • LicenseId

        • Example: 25044988246

      • LicenseStatus

        • Example: Warning

      • MaxLines

      • MaxLinesPerSolution

      • Message

        • Example: Success. License: 25044988246

      • Name

      • RemainingDays

      • RemainingLines

      • StartDate

      • UnlimitedLinesEnabled

        • Example: False

  • Activation Start

    • Deprecated

    • Attributes

      • ClientTimestamp

      • Name

  • Activation Validation

    • Sent from VBUC > src > Manager > Shell > ViewModel > WindowsDialogServices > LegacyForms > frmLicenseActivator

    • Attributes

      • ClientTimestamp

      • Name

      • Message

        • Possible values:

          • License Expired

          • Invalid File

          • Cannot Copy File

          • Success

  • CloseSession

    • Automatic Event

    • Attributes

      • ClientTimestamp

      • Name

  • CloseSolution

    • Deprecated

    • Attributes

      • ClientTimestamp

      • Name

  • CreateSession

    • Deprecated

    • Attributes

      • BinaryName

        • Example: vbucCmd

      • ClientTimestamp

      • CompanyName

        • Example: Mobilize.net

      • CompName

        • Example: S04-VW8-VBUC01

        • Description: Computer Name

      • ElevatedAdmin

        • Example: False

      • IPAddress

      • Name

      • OSVersion

        • Example: Win8/Win2012Server (Microsoft Windows NT 6.2.9200.0)

      • ProductName

        • Example: Mobilize.Net® Visual Basic Upgrade Companion 9.0 (Beta)

      • Version

        • 9.0.51216.0

  • Migration Ended

    • Sent from VBUC > src > Manager > Shell > ViewModel > ProgressViewModel.cs

    • Attributes

      • ClientTimestamp

      • LOCRemaining

      • Name

      • PreProcessProgress

        • Example: 100

      • RAM

        • Example: 2047Mb

      • UpgradeProgress

        • Example: 0

  • Migration Exception

    • Sent from VBUC > src > Manager > Shell > ViewModel > ProgressViewModel.cs

    • Attributes

      • ClientTimestamp

      • Message

      • Name

  • Migration Failed

    • Sent from

      • VBUC > src > Manager > Shell > ViewModel > ProgressViewModel.cs

      • VBUC > src > Manager > Shell > Implementations > UpgradeCommand.cs

    • Attributes

      • ClientTimestamp

      • Message

        • Possible values

          • License is not valid

          • Process Failed

      • Name

  • Migration Interrupted (Properties are similar to migration ended)

    • Sent from VBUC > src > Manager > Shell > ViewModel > ProgressViewModel.cs

    • Attributes

      • ClientTimestamp

      • LOCRemaining

      • Name

      • PreProcessProgress

      • RAM

      • UpgradeProgress

  • Migration Started

    • Sent from VBUC > src > Manager > Shell > ViewModel > ProgressViewModel.cs

    • Attributes

      • Action

        • Example: Preprocess

      • ClientTimestamp

      • HelpersIntegration

        • Example: SourceCode

      • LicenseStatus

        • Example: Warning

      • LOC

      • LOCRemaining

      • Name

      • Projects

      • RAM

        • Example: 2047Mb

      • Target

        • Example: .csproj

      • VSVersion

        • Example: VisualStudio2015

  • NewSolution

    • Deprecated

    • Attributes

      • ClientTimestamp

      • Name

  • OpenSolution

    • Deprecated

    • Attributes

      • ClientTimestamp

      • Name

  • Phase Changed

    • Sent from src/Manager/Shell/ViewModel/MainViewModel.cs

    • Attributes

      • AllFilesFound

        • Example: True

      • ClientTimestamp

      • Name

      • OptionsAccepted

        • Example: False

      • RefsResolved

        • Example: True

      • SolutionLoaded

        • Example: True

      • Stage

        • Example: Options

  • Solution Close

    • Sent from src/Manager/Shell/ViewModel/SolutionViewModel.cs

    • Attributes

      • ClientTimestamp

      • Name

  • Solution New

    • Sent from src/Manager/Shell/ViewModel/SolutionViewModel.cs

    • Attributes

      • AllFilesFound

        • Example: False

      • ClientTimestamp

      • LOC

      • Message

        • Example: Success

      • Name

      • OptionsAccepted

        • Example: False

      • Projects

        • Example: 47

      • RefsResolved

        • Example: False

      • SolutionLoaded

        • Example: True

  • Solution Open

    • Sent from src/Manager/Shell/ViewModel/SolutionViewModel.cs

    • Attributes

      • AllFilesFound

        • Example: True

      • ClientTimestamp

      • LOC

      • Message

        • Example: Success

      • Name

      • OptionsAccepted

        • Example: True

      • Projects

        • Example: 40

      • RefsResolved

        • Example: False

      • SolutionLoaded

        • Example: False

  • Initializing (has properties that have already been mentioned)

    • Sent from src/Manager/Shell/ViewModel/MainViewModel.cs

    • Attributes

      • ClientTimestamp

      • Company

      • DateRegistered

      • ExpirationDate

      • IsTrial

      • LicenseId

      • LicenseStatus

      • MaxLines

      • MaxLinesPerSolution

      • Message

      • Name

      • RemainingDays

      • RemainingLines

      • StartDate

      • UnlimitedLinesEnabled

  • Kích ho?t xong

    • This event is an outlier and should not be taken seriously

Last updated