GitHubContribute in GitHub: Edit online

copyright: years: 2017, 2018 lastupdated: "2023-02-10"


Reporting events in SMS Gateway

These events are created in a JSON object form that can be easily integrated with a Splunk HTTP Event Collector (HEC). You can configure SMS Gateway to publish the reporting events to either IBM Cloudant, CouchDB, or a REST server that stores the events. The transcription events are batched before sending to the configured reporting resources.

SMS Gateway also supports default file backup in case the configured reporting service is offline. Events that are recorded to the backup are sent to the reporting service when it becomes available. See Creating a reporting event system backup.

SMS Gateway can generate the following types of reporting events. Learn more about how to configure and use reporting events in each section.

  • Transcription events

    These events are reported for every inbound and outbound message during an SMS transaction. Since message exchanges can produce many reporting events, transcription reporting events are batched for each tenant after every 10 seconds. Then, the batched reporting events are sent to the reporting server.

  • Usage events

    A total number of inbound and outbound messages for each tenant are reported from each instance of the SMS Gateway after every 10 seconds.

    The following messages are counted to determine the usage for each tenant.

    • The outgoing message to the user from Watson Assistant or the SMS pipe
    • The received inbound message from the user or SMS pipe.

Batching events

The transcription events are reported for every inbound and outbound message during an SMS transaction. Sending these events individually can lead to higher network traffic or overloading your reporting servers. To prevent these problems, events are batched to reduce the frequency messages are sent to the REST server or IBM Cloudant service. By default, the reporting events are batched every 10 seconds.

Reporting event system backup

The reporting event system backup prevents data loss if the reporting event storage service is offline.

The default report backup directories in the container for transcription and usage are /mnt/transcriptionReporting and /mnt/usageReporting. These can be can be mounted and mapped to the working directories using persistent volumes. You can enable limits on the number of reporting backup files that your system uses.

The following example shows how to mount the backup directory for transcription reporting events to your persistent volume at the filepath, /your.directory/smsgwTranReports.

  1. Define "kind":"PersistentVolume".

{ "kind":"PersistentVolume", "apiVersion":"v1", "metadata":{ "name":"smsgw-transcription-reports", "labels":{ "name":"smsgw-transcription-reports" } }, "spec":{ "capacity":{ "storage":"2Gi" }, "accessModes":[ "ReadWriteMany" ], "persistentVolumeReclaimPolicy":"Retain", "hostPath":{ "path":"/root/smsgwTranReports" } } }

1.  Define `"kind":"PersistentVolumeClaim"`.

  ```json {: codeblock}
{ "kind":"PersistentVolumeClaim",
   "apiVersion":"v1",
   "metadata":{
      "name":"smsgw-transcription-reports"
   },
   "spec":{
      "resources":{
         "requests":{
            "storage":"2Gi"
         } },
      "selector":{
         "matchLabels":{
            "name":"smsgw-transcription-reports"
         } },
      "accessModes":[
         "ReadWriteMany"
      ] } }
  1. Define the volumeMount in your container in "kind":"Deployment".

"volumeMounts": [{ "name": "smsgw-transcription-reports", "mountPath": "/mnt/transcriptionReporting" }]

1. Define the volume by mapping `PersistentVolumeClaim` and `volumeMount` in `"kind": "Deployment"`.

  ```json {: codeblock}
"spec": {
 "volumes": [{
      "persistentVolumeClaim": {
       "claimName": "smsgw-transcription-reports"
       },
       "name": "smsgw-transcription-reports"
    }]
  }