Analize your extensions through custom telemetry

Analiza tus extensiones a través de la telemetría personalizada

Es posible que deseemos realizar un seguimiento de información adicional específica de la extensión. Debemos seleccionar señales sobre las cuales se pueda actuar y que la siguiente pregunta tenga una respuesta: ¿qué puede hacer el cliente o el partner con estas señales de telemetría?

Configuración

Obtenemos el valor de la cadena de conexión del servicio de Application Insights del partner, los datos de las señales de telemetría personalizadas de la extensión se recopilerán en este servicio.

Session.LogMessage

Se debe usar este método en el objeto que emita la señal de la telemetría a seguir y analizar.

Session.LogMessage(EventId: Text, Message: Text, Verbosity: Verbosity, DataClassification: DataClassification, TelemetryScope: TelemetryScope, CustomDimensions: Dictionary of [Text, Text])

Los parámetros de este método son los siguientes:

  • EventID: Es el ID del evento que desea enviar. Se debe intentar que sean únicas
  • Message: Es el contenido del mensaje para el evento que deseamos enviar.
  • Verbosity: Enumeración que especifica el nivel de gravedad de la señal de seguimiento de telemetría. El valor puede ser Crítico, Error, Advertencia, Normal o Detallado.
  • DataClassification: La telemetría debe respetar la privacidad. Los eventos con una clasificación de datos distinta de SystemMetadata no se envían a los recursos de Application Insight. Es importante revisar las llamadas de LogMessage para evitar que se envíen datos sensibles del cliente a los recursos de Azure.

Consideraciones

Se incluyen automáticamente varias dimensiones personalizadas en las llamadas de seguimiento que se envían a Application Insights. Por ejemplo datos genéricos de la extensión y del objeto que llama al método Session.LogMessage:

Estas señales de telemetría personalizada la podemos utilizar adicionalmente para:

  • Identificar que funcionalidades están o no están en uso en nuestra aplicación
  • Acompañar en el proceso de onboarding de los clientes
  • Analizar procesos y mejorar nuestra aplicación

Las definiciones de eventos de telemetría deben tratarse como una API por lo que deben estar documentadas, versionadas y deben evitar modificarse de manera que rompa una implementación anterior, por ejemplo un cambio de dimensiones.

Los eventos de telemetría deben documentarse correctamente orientando en la actuación ante un evento determinado.

Ejemplo

Si deseamos enviar una señal de telemetría personalizada con gravedad critica deberíamos hacer algo similar a lo siguiente (el código se ejecuta en un botón de una página extendida).

    trigger OnAction()

var
CustomTelemetryDimensions: Dictionary of [Text, Text];
begin
CustomTelemetryDimensions.Add('dimension1', 'dimension value 1');
CustomTelemetryDimensions.Add('dimension2', 'dimension value 2');
Session.LogMessage('GDRGDev_CustomTelemetry_01',
'Custom Telemetry Critical SystemMetadata: Spain hour' + FORMAT(Today()) + FORMAT(Time()),
Verbosity::Critical,
DATACLASSIFICATION::SystemMetadata,
TelemetryScope::ExtensionPublisher,
CustomTelemetryDimensions);
Message('GDRGDev_CustomTelemetry_02 Signal sent!');
end;

También se realiza un ejemplo con el parámetro DataClassification diferente a SystemMetaData y como se indicó anteriormente, esta señal no es recopilada en el servicio de Application Insights por motivos de privacidad.

KQL

Obtenemos un listado de los eventos con el código de EventID correspondiente.

Visualizamos las dimensiones personalizadas y por defecto de cada evento de telemetría personalizado.

También podemos agrupar por tipo de evento y por día, lo que nos permitirá analizar la recurrencia y ejecutar los pasos de acción correspondientes por cada uno de ellos.

En resumen, la telemetría personalizada nos permite adaptar el monitoreo a las necesidades únicas de nuestras extensiones. Ya sea rastreando eventos específicos, analizando el comportamiento del usuario o midiendo métricas personalizadas, la telemetría siempre nos proporciona información esencial para mantener y mejorar nuestras extensiones.

Espero que esta información te ayude.


Analize your extensions through custom telemetry

We may want to track additional information specific to the extension. We must select signals that can be acted upon and have an answer to the following question: what can the customer or partner do with these telemetry signals?

Setting

We get the connection string value from the partner’s Application Insights service, the extension’s custom telemetry data will be collected in this service.

Session.LogMessage

This method must be used on the object that emits the telemetry signal to be followed and analyzed.

Session.LogMessage(EventId: Text, Message: Text, Verbosity: Verbosity, DataClassification: DataClassification, TelemetryScope: TelemetryScope, CustomDimensions: Dictionary of [Text, Text])

The parameters of this method are the following:

  • EventID: This is the ID of the event you want to send. You should try to make them unique.
  • Message: It is the content of the message for the event that we want to send.
  • Verbosity: Enumeration that specifies the severity level of the telemetry trace signal. The value can be Critical, Error, Warning, Normal or Verbose.
  • DataClassification: Telemetry must respect privacy. Events with a data classification other than SystemMetadata are not sent to Application Insight resources. It is important to review LogMessage calls to prevent sensitive customer data from being sent to Azure resources.

Considerations

Several custom dimensions are automatically included in custom telemetry event sent to Application Insights. For example, generic data of the extension and the object that calls the Session.LogMessage method:

We can additionally use these custom telemetry events to:

  • Identify which functionalities are or are not in use in our application
  • Assist in the customer onboarding process
  • Analyze processes and improve our application

Custom telemetry event definitions should be treated as an API so they should be documented, versioned, and should avoid being modified in a way that breaks a previous implementation, for example a dimension change.

Custom telemetry events must be correctly documented, guiding the response to a given event.

Example

If we want to send a custom telemetry signal with critical severity we should do something similar to the following (the code is executed in a button on an extended page).

    trigger OnAction()

var
CustomTelemetryDimensions: Dictionary of [Text, Text];
begin
CustomTelemetryDimensions.Add('dimension1', 'dimension value 1');
CustomTelemetryDimensions.Add('dimension2', 'dimension value 2');
Session.LogMessage('GDRGDev_CustomTelemetry_01',
'Custom Telemetry Critical SystemMetadata: Spain hour' + FORMAT(Today()) + FORMAT(Time()),
Verbosity::Critical,
DATACLASSIFICATION::SystemMetadata,
TelemetryScope::ExtensionPublisher,
CustomTelemetryDimensions);
Message('GDRGDev_CustomTelemetry_02 Signal sent!');
end;

An event is also made with the DataClassification parameter other than SystemMetaData and as indicated above, this event is not collected in the Application Insights service for privacy reasons.

KQL

We obtain a list of the events with the corresponding EventID code.

We display the custom and default dimensions of each custom telemetry event.

We can also group by type of event and by day, which will allow us to analyze the recurrence and execute the corresponding action steps for each of them.

In short, custom telemetry allows us to tailor monitoring to the unique needs of our extensions. Whether tracking specific events, analyzing user behavior, or measuring custom metrics, telemetry always provides us with essential information to maintain and improve our extensions.

I hope this information helps you.


Más información / More information

Una respuesta a “Analize your extensions through custom telemetry”

  1. […] Analize your extensions through custom telemetry – Gerardo Rentería Blog […]

    Me gusta

Replica a Telemetry in Action 🧐: Track User Activities in BC 🔍 – Gerardo Rentería Blog Cancelar la respuesta