Events
An event is a singular data point which represents a critical information regarding the state of the application. An event would have a name as well as a payload with associated attributes in it.
For different industries and products, the events that represent your customer experience could be different. For using the stateful monitoring features in Doctor Droid, you need to ensure to pass a common key in all your events of a certain type. All events that are for a specific customer, order or transaction must have the same value for that key.
A typical event looks like this:
name -> This is the event type. Its a string.
timestamp -> This is the time of the occurrence of that event. If not passed, Doctor Droid assumes it to be the current time. This should epoch time in milliseconds.
payload -> This is a json object with keys and their values that detail out the event. One of these keys have to be the group key that is repeated across all events of the same entity.
Events Modelling
Below are some examples of events from popular use-cases that you can send to Doctor Droid.
Order Fulfilment
For example, the following event represents order journey on a food delivery platform from being created to being delivered. They can help you monitor delay patterns at a store or city level or how much adherence you have to promised ETAs.
{
"name": "OrderCreated",
"timestamp": 1677751161120,
"payload": {
"order_id": "ekpsHJ9GhQd7OU",
"city": "Bengaluru",
"store_code": "PZHT0056",
"order_value": 435,
"promised_eta": 23
}
}
{
"name": "OrderShipped",
"timestamp": 1677751561100,
"payload": {
"order_id": "ekpsHJ9GhQd7OU",
"delivery_eta": 14,
"driver_id": 32432
}
}
{
"name": "OrderDelivered",
"timestamp": 1677752561100,
"payload": {
"order_id": "ekpsHJ9GhQd7OU",
"delivery_eta": 14
}
}
Payment Gateway
Similarly, for a payment gateway integration with stripe, you can create the following events to monitor callback success rate for each card_type.
{
"name": "Payment_Started"
"timestamp": 1677751161100,
"payload": {
"transaction_id": "si_LULhDM2vvvt7yZ",
"amount": 54.8,
"currency": "usd",
"card_type": "amex",
"invoice_id": "in_1KnN0G589O8KAxCGfVSpD0Pj"
}
{
"name": "Payment_Callback"
"timestamp": 1677751261100,
"payload": {
"transaction_id": "si_LULhDM2vvvt7yZ",
"status": "paid",
"payment_method": "cc"
}
Vendor Payments
For a B2B payment flow through NetBanking API calls, you can create the following events to monitor recipient bank level success rates and any breakage in the callback or recipient notification pipeline.
{
"name": "Transfer_Prepared"
"timestamp": 1677751161100,
"payload": {
"recipient_id": "tWaIb3aK3vlHn9",
"amount": 10323,
"currency": "inr",
"recipient_bank": "citi",
"source_bank": "hdfc"
}
{
"name": "Transfer_Initiated"
"timestamp": 1677751361100,
"payload": {
"recipient_id": "tWaIb3aK3vlHn9",
"transaction_id": "98363ixIwXnh07L5DuLvQE6c",
"bank_api_status_code": "0004",
"transaction_status": "pending"
}
{
"name": "Transfer_Completed"
"timestamp": 1677751461100,
"payload": {
"recipient_id": "tWaIb3aK3vlHn9",
"transaction_id": "98363ixIwXnh07L5DuLvQE6c",
"transaction_status": "success"
}
{
"name": "Recipient_Notified"
"timestamp": 1677751561011,
"payload": {
"recipient_id": "tWaIb3aK3vlHn9",
"transaction_id": "98363ixIwXnh07L5DuLvQE6c",
"email_sent": true,
"sms_sent": false
}
You can check how to send these events in our data sources.
Updated about 1 month ago