Skip to content

Pushing Metrics Events Logs to SNS for Analytics

Shailesh Baldaniya edited this page Jun 22, 2022 · 2 revisions

Goal

To push metrics and event data from the Livechat widget and RC Apps to SNS Topic(Ciao Analytics Service).

Links

Frontend Analytics Wiki: https://wiki.viasat.com/pages/viewpage.action?spaceKey=ACC&title=Frontend+Analytics

Analytics, Monitoring, and Alerting Wiki: https://wiki.viasat.com/display/ACC/Analytics%2C+Monitoring%2C+and+Alerting

Diagram

Metrics Logging SNS

Design

The Livechat widget and RC Apps will communicate with the Rocket.Chat server and the server will push logging/metric/event data to SNS Topic

RC Server

LiveChat Widget

  • Livechat widget communicates to Rocket.Server using Websocket/REST APIs(using Rocket.chat.js.sdk). For this use case, we will use REST API.
  • Server uses AnalyticsLogger to push data.

RC App

Example Payload

{
"application": "WhatsApp",
"business": "BR",
"ciao_deployment": "brazil-prod",
"dialogflow_agent_id": "b5983b72-cac6-4f85-b9d0-be61e543dfe6",
"event": "outage_info_requested",
"event_detail_1": "none",
"event_detail_2": "none",
"event_detail_3": null,
"event_detail_4": null,
"event_type": "customer_action",
"party_id": "3a5bf619-6353-4412-a21b-bf2b1eab94db",
"session_id": "dfcx:b5983b72-cac6-4f85-b9d0-be61e543dfe6:wqbFXoeX2kdSZhSyi",
"source_component": "Ciao",
"timestamp": 1651688848191
}

Open Questions

  • What's the latest minimal required payload?
  • If the payload requires dialogflow_agent_id/ciao_deployment, from where to get that? One option is to make it configurable in DF App settings
Clone this wiki locally