Prometheus Metrics Hybrid Chat

Some Hybrid Chat components expose metrics for Prometheus. These metrics can be plotted using Grafana or any other dashboard that supports Prometheus data source. 

The details of currently available Prometheus Metrics are below:

Channel Manager

The Channel Manager 3.x exposes the following metrics for Prometheus:



MetricRequest DirectionURLNameTag FilterCalculation FormulaAlarmingDescription
1Total Inbound Requests Count per Channel

INBOUND

/ccm/actuator/prometheushttp_server_requests_seconds_count Filter using uri tag to detect channel

The total number of messages received by the Channel Manager for every configured channel since the last restart.
See URI mapping in the below table for filtering the channel.
2Failed Inbound Requests Count

INBOUND

/ccm/actuator/prometheushttp_server_requests_seconds_countFilter using uri tag to detect channel
AND
Filter using status != 200 tag to detect failed requests


The total number of messages for every configured channel that the Channel Manager failed to process since the last restart.
See URI mapping in the below table for filtering the channel.
3Successfully Processed Inbound Requests Count

INBOUND

/ccm/actuator/prometheushttp_server_requests_seconds_countFilter using uri tag to detect channel
AND
Filter using status = 200 tag to detect failed requests

The total number of messages for every configured channel that the Channel manager successfully processed since the last restart.
See URI mapping in the below table for filtering the channel.
4Average Process Duration for Inbound Requests

INBOUND

/ccm/actuator/prometheus

http_server_requests_seconds_sum

AND

http_server_requests_seconds_count

Filter using uri tag to detect channelrate(http_server_requests_seconds_sum[5s])/ rate(http_server_requests_seconds_count[5s])

≥ 5 SECONDS

Average process duration that the Channel Manager took to process receiving inbound requests since last 5 seconds.
See URI mapping in the below table for filtering the channel.
5Total Outbound Messages Count per Channel

OUTBOUND

/ccm/actuator/prometheus{channel}_outbound_request_total Filter using {channel} name

The number of outbound messages processed by the Channel Manager since the last restart.
See {channel}  mapping in the below table for filtering the channel.
6Successfully Processed Outbound Requests Count

OUTBOUND

/ccm/actuator/prometheus{channel}_outbound_successful_request_total Filter using {channel} name

All messages delivered by the Channel Manager to the specified channel since the last restart. If and when the Channel Manager cannot send a message, it will either retry (increasing failure retries) or will mark the message as invalid (increasing invalid messages count).
See {channel}  mapping in the below table for filtering the channel.
7Total Invalid Outbound Messages Count

OUTBOUND

/ccm/actuator/prometheus{channel}_outbound_invalid_request_total Filter using {channel} name

Bad messages (bad request) received from the Chat Server that the 3rd party channel denied acceptance since the last restart.
See {channel}  mapping in the below table for filtering the channel.
8Total Failed Outbound Messages Retries Count

OUTBOUND

/ccm/actuator/prometheus{channel}_outbound_failed_request_total Filter using {channel} name

≥ 5

Total number of retries that the Channel Manager took o process the last outbound message.
See {channel}  mapping in the below table for filtering the channel.
9Average Process Duration of Outbound Messages

OUTBOUND

/ccm/actuator/prometheus{channel}_outbound_request_seconds_sum

AND

{channel}_outbound_request_seconds_count
Filter using {channel} namerate({channel}_outbound_request_seconds_sum[5s])/ rate({channel}_outbound_request_seconds_count[5s])

≥ 5 SECONDS

The average process duration that the Channel Manager took to process an outbound message for the last 5 seconds.
See {channel}  mapping in the below table for filtering the channel.


URI Mapping

For filtering incoming requests' Prometheus metrics, refer to the below URI mapping table


ChannelVendorURIDescription
1WhatsAppTwilio/msg-client/receive 
2WhatsApp360Dilaog/d360 
3SMS/MMSTwilio/msg-client/receive
4Facebook MessengerFacebook Graph API/webhook 
5ViberViber Rest API/viber


Channel-based Filtering

The following table shows the channel mapping with keywords that are used in the {channel} parameter in Prometheus outbound stats exposed by the Channel Manager.



ChannelVendorFilter KeywordDescription
1WhatsAppTwiliowhatsapp_twilio Use this keyword to filter outbound metrics per channel. e.g. whatsapp_twilio_outbound_requests_total provides count of total outbound requests for WhatsApp channel via Twilio.
2WhatsApp360Dialogwhatsapp_d360 Use this keyword to filter outbound metrics per channel. e.g. whatsapp_d360_outbound_requests_total provides count of total outbound requests for WhatsApp channel via Dialog360.
3SMS/MMSTwiliosms_twilio Use this keyword to filter outbound metrics per channel. e.g. sms_twilio_outbound_requests_total provides count of total outbound requests for SMS/MMS channel via Twilio.
4SMSSMPPsmpp Use this keyword to filter outbound metrics per channel. e.g. smpp_outbound_requests_total provides count of total outbound requests for SMS channel via an SMPP gateway.
5Facebook MessengerFacebook Graph APIfacebook 

Use this keyword to filter outbound metrics per channel. e.g. facebook_outbound_requests_total provides count of total outbound requests for the Facebook Messenger channel.

6Social Media FeedFacebook Graph APIsm_feed Use this keyword to filter outbound metrics per channel. e.g. sm_feed_outbound_requests_total provides count of total outbound requests for the Social Media Feed channel.
7ViberViber Rest APIviber Use this keyword to filter outbound metrics per channel. e.g. viber_outbound_requests_total provides count of total outbound requests for the Viber channel.


Reporting Connector

The Reporting Connector 3.x exposes the following metrics for Prometheus:


NameURLDescription
failed_query_count<ip-address>:8496/api/metricsThe total number of failed queries in error.sql file.

Chat Server

The Chat Server 3.x exposes the following metrics for Prometheus:


NameURLDescription
conversation_count/chat/metricsShows the currently active conversations, including the conversations waiting in queues.

The metrics provided in this document are custom-based. For java and node.js technology-based metrics visit the relevant URL. 

For database connector technology based metrics visit https://<fqdn>/database-connector/metric

For bot connector technology based metrics visit https://<fqdn>/database-connector/metrics