SBA Gateway Kafka Producer Write to Disk Logging Function

When SBA Gateway streams charging data record (CDR) data to Kafka, the Write to Disk logging function writes each CDR to a log file in a persistent volume (PV) when the Kafka broker is not available. When access to Kafka is restored, records on disk can be replayed using the cdr-kafka-replay microservice.

Write to Disk with Logger Configuration Properties describes the available configuration properties.

Table 1. Write to Disk with Logger Configuration Properties
Property Description
sba-5gc.events.shutdownSeconds The duration in seconds that the CHF remains available while shutting down. This is the default used in Kubernetes. The default value is 30.
sba-5gc.events.kafka.enabled When set to true, the Kafka producer is enabled. The default value is false.
sba-5gc.events.kafka.logger.enabled When set to true, the logger function is enabled. Records expired or rejected from the Kafka producer client are written to a log file on the configured PV. If false, expired or rejected records are discarded. The default value is false.
sba-5gc.events.kafka.logger.outputStorage.createPersistentVolumeClaim When set to true, the Helm chart creates a persistent volume claim (PVC) with a default name of release-shared-networkcdr-storage.

When set to false, you must pre-create the PVC. If you use a name different from the default name, set sba-5gc.events.kafka.logger.outputStorage.pvcName to the name of the PVC. The default value is false.

sba-5gc.events.kafka.logger.outputStorage.createPersistentVolume When set to true, the Helm chart creates a PV used by the Logger for saving failed records. The PV has a default name of release-networkcdr-storage. Use this setting for testing and debugging purposes. Do not use this setting in production environments.

When set to false, you must pre-create the PV. If you use a name different from the default name, set sba-5gc.events.kafka.logger.outputStorage.pvName to the name of the PVC. The default value is false.

sba-5gc.events.kafka.logger.outputStorage.pvcName The name of the PVC if different from the default. The default value is release-shared-networkcdr-storage.
sba-5gc.events.kafka.logger.outputStorage.pvName The name of the PVC, if different from the default. The default value is release-shared-networkcdr-storage.
sba-5gc.events.kafka.logger.outputStorage.annotations A dictionary of annotations to add to the PVC. For more information, see the discussion about annotations in Kubernetes documentation at the Kubernetes website.
sba-5gc.events.kafka.logger.outputStorage.storage The PV storage size used when createPersistentVolume is set to true. The default value is 10Gi.
sba-5gc.events.kafka.logger.outputStorage.storageClassName The PV storage class name used when createPersistentVolume is set to true. The default value is an empty string.
sba-5gc.events.kafka.logger.outputStorage.persistentVolume Additional PV configuration when createPersistentVolume is set to true. For more informatio,n see PV documentation at the Kubernetes website.
sba-5gc.events.kafka.logger.outputStorage.dynamicProvisioning When set to true, the PVC is used to dynamically provision a PV. In this case, the value of sba-5gc.events.kafka.logger.outputStorage.pvName is not used. Use this property in conjunction with global.storage.shared.createPersistentVolume set to false.

Configuration Behavior describes the effects of various configuration combinations on 5G event streaming.

Table 2. Configuration Behavior
Configuration Behavior
events.kafka.enabled=false
SBA Gateway does not send any records to Kafka.
events.kafka.enabled=true
SBA Gateway sends records to Kafka, but records that could not be sent are not logged. A warning of the failure cause is logged and a failed record send metric is incremented.
events.kafka.enabled=true
events.kafka.logger.enabled=true
SBA Gateway sends records to Kafka and any records that could not be sent are logged. A warning of the failure cause is logged and a failed record send metric is incremented. A PV and PVC must be manually created.
events.kafka.enabled=true
events.kafka.logger.enabled=true
events.kafka.logger.outputStorage.createPersistentVolumeClaim=true
SBA Gateway sends records to Kafka and any records that could not be sent are logged. A warning of the failure cause is logged and a failed record send metric is incremented. A PVC is created, but the PV must be manually created.
events.kafka.enabled=true
events.kafka.logger.enabled=true
events.kafka.logger.outputStorage.createPersistentVolumeClaim=true
events.kafka.logger.outputStorage.createPersistentVolume=true
SBA Gateway sends records to Kafka and any records that cannot be sent are logged. A warning of the failure cause is logged and a failed record send metric is incremented. A PVC and PV are created, and the PV is created as a hostPath volume.

For more information about 5G event streaming Write to Disk functionality, see the discussion about Write to Disk in MATRIXX 5G Event Streaming.