Breadcrumbs

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:



Metric

Request Direction

URL

Name

Tag Filter

Calculation Formula

Alarming

Description

1

Total Inbound Requests Count per Channel

INBOUND

/ccm/actuator/prometheus

http_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.

2

Failed Inbound Requests Count

INBOUND

/ccm/actuator/prometheus

http_server_requests_seconds_count

Filter 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.

3

Successfully Processed Inbound Requests Count

INBOUND

/ccm/actuator/prometheus

http_server_requests_seconds_count

Filter 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.

4

Average 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 channel

rate(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.

5

Total 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.

6

Successfully 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.

7

Total 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.

8

Total 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.

9

Average Process Duration of Outbound Messages

OUTBOUND

/ccm/actuator/prometheus

{channel}_outbound_request_seconds_sum

AND

{channel}_outbound_request_seconds_count

Filter using {channel} name

rate({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



Channel

Vendor

URI

Description

1

WhatsApp

Twilio

/msg-client/receive


2

WhatsApp

360Dilaog

/d360


3

SMS/MMS

Twilio

/msg-client/receive


4

Facebook Messenger

Facebook Graph API

/webhook


5

Viber

Viber 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.



Channel

Vendor

Filter Keyword

Description

1

WhatsApp

Twilio

whatsapp_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.

2

WhatsApp

360Dialog

whatsapp_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.

3

SMS/MMS

Twilio

sms_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.

4

SMS

SMPP

smpp

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.

5

Facebook Messenger

Facebook Graph API

facebook

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.


6

Social Media Feed

Facebook Graph API

sm_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.

7

Viber

Viber Rest API

viber

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:


Name

URL

Description

failed_query_count

<ip-address>:8496/api/metrics

The total number of failed queries in error.sql file.

Chat Server

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


Name

URL

Description

conversation_count

/chat/metrics

Shows 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